Initial Server Response Time (Nuxt 3 SSR)

PLEASE help us help you by writing a good post!

We switched to a PRO Account on Netlify, but what we still stumble across is the initial server response time which seems pretty slow and disturbing.

Site: https://frolicking-clafoutis-07566a.netlify.app or https://www.regiolix-solutions.at/

I’ve run both domains through testmysite.io (Website Speed Test Tool - Testmysite.io by Netlify) where the result confirms lighthouse and my “personal eye”.

There seems not build problems except a few warning from netlify functions. Maybe there’s a problem though?

Summary
10:29:05 AM: ────────────────────────────────────────────────────────────────
10:29:05 AM:   Netlify Build                                                 
10:29:05 AM: ────────────────────────────────────────────────────────────────
10:29:05 AM: ​
10:29:05 AM: ❯ Version
10:29:05 AM:   @netlify/build 27.16.1
10:29:05 AM: ​
10:29:05 AM: ❯ Flags
10:29:05 AM:   baseRelDir: true
10:29:05 AM:   buildId: 630dca37965ad70009907ffd
10:29:05 AM:   deployId: 630dca37965ad70009907fff
10:29:05 AM: ​
10:29:05 AM: ❯ Current directory
10:29:05 AM:   /opt/build/repo
10:29:05 AM: ​
10:29:05 AM: ❯ Config file
10:29:05 AM:   No config file was defined: using default values.
10:29:05 AM: ​
10:29:05 AM: ❯ Context
10:29:05 AM:   production
10:29:05 AM: ​
10:29:05 AM: ────────────────────────────────────────────────────────────────
10:29:05 AM:   1. Build command from Netlify app                             
10:29:05 AM: ────────────────────────────────────────────────────────────────
10:29:05 AM: ​
10:29:05 AM: $ yarn build
10:29:05 AM: yarn run v1.22.10
10:29:05 AM: $ nuxt build
10:29:05 AM: [log] Nuxt CLI v3.0.0-rc.4
10:29:08 AM: [warn] [kit] [compat] Using `extendBuild` in Nuxt 3 has no effect. Instead call extendWebpackConfig and extendViteConfig.
10:29:08 AM: [info] [nuxt:tailwindcss] Merging Tailwind config from ~/../tailwind.config.js
10:29:10 AM: [info] Vite client warmed up in 1905ms
10:29:15 AM: [info] Client built in 6529ms
10:29:15 AM: [info] Building server...
10:29:18 AM: [success] Server built in 2867ms
10:29:18 AM: [success] [nitro] Generated public dist
10:29:18 AM: [start] [nitro] Building server...
10:29:23 AM: [start] [nitro] Writing server bundle...
10:29:24 AM: [success] [nitro] Server built
10:29:24 AM:   ├─ .netlify/functions-internal/server/server.ts (524 B) (294 B gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/package.json (1.01 kB) (425 B gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/nitro/aws-lambda.mjs.map (19.9 kB) (3.61 kB gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/nitro/aws-lambda.mjs (16.7 kB) (5.23 kB gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/handlers/renderer.mjs.map (1.92 MB) (91.3 kB gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/handlers/renderer.mjs (431 kB) (98.6 kB gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/app/server.mjs.map (470 kB) (59.1 kB gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/app/server.mjs (554 kB) (109 kB gzip)
10:29:24 AM:   ├─ .netlify/functions-internal/server/chunks/app/client.manifest.mjs.map (5 kB) (843 B gzip)
10:29:24 AM:   └─ .netlify/functions-internal/server/chunks/app/client.manifest.mjs (8.2 kB) (1.18 kB gzip)
10:29:24 AM: Σ Total size: 6.76 MB (1.17 MB gzip)
10:29:24 AM: Done in 19.03s.
10:29:24 AM: ​
10:29:24 AM: (build.command completed in 19.2s)
10:29:24 AM: ​
10:29:24 AM: ────────────────────────────────────────────────────────────────
10:29:24 AM:   2. Functions bundling                                         
10:29:24 AM: ────────────────────────────────────────────────────────────────
10:29:24 AM: ​
10:29:24 AM: Packaging Functions from .netlify/functions-internal directory:
10:29:24 AM:  - server/server.ts
10:29:24 AM: ​
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/ufo/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:3:7:
10:29:24 AM:       3 │ import 'ufo';
10:29:24 AM:         ╵        ~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/ufo/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/h3/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:4:7:
10:29:24 AM:       4 │ import 'h3';
10:29:24 AM:         ╵        ~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/h3/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/ohmyfetch/dist/node.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:5:7:
10:29:24 AM:       5 │ import 'ohmyfetch';
10:29:24 AM:         ╵        ~~~~~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/ohmyfetch/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/radix3/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:7:7:
10:29:24 AM:       7 │ import 'radix3';
10:29:24 AM:         ╵        ~~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/radix3/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/scule/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:10:7:
10:29:24 AM:       10 │ import 'scule';
10:29:24 AM:          ╵        ~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/scule/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/ohash/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:11:7:
10:29:24 AM:       11 │ import 'ohash';
10:29:24 AM:          ╵        ~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/ohash/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/unstorage/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/server.ts:12:7:
10:29:24 AM:       12 │ import 'unstorage';
10:29:24 AM:          ╵        ~~~~~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/unstorage/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/h3/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/chunks/app/server.mjs:8:7:
10:29:24 AM:       8 │ import 'h3';
10:29:24 AM:         ╵        ~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/h3/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/ohmyfetch/dist/node.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/chunks/app/server.mjs:12:7:
10:29:24 AM:       12 │ import 'ohmyfetch';
10:29:24 AM:          ╵        ~~~~~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/ohmyfetch/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: ▲ [WARNING] Ignoring this import because ".netlify/functions-internal/server/node_modules/radix3/dist/index.mjs" was marked as having no side effects
10:29:24 AM:     .netlify/functions-internal/server/chunks/app/server.mjs:14:7:
10:29:24 AM:       14 │ import 'radix3';
10:29:24 AM:          ╵        ~~~~~~~~
10:29:24 AM:   "sideEffects" is false in the enclosing "package.json" file
10:29:24 AM:     .netlify/functions-internal/server/node_modules/radix3/package.json:7:2:
10:29:24 AM:       7 │   "sideEffects": false,
10:29:24 AM:         ╵   ~~~~~~~~~~~~~
10:29:24 AM: 10 of 13 warnings shown (disable the message limit with --log-limit=0)
10:29:25 AM: ​
10:29:25 AM: ❯ Functions bundled with warnings:
10:29:25 AM:    - server.zip
10:29:25 AM: ​
10:29:25 AM: (Functions bundling completed in 414ms)
10:29:25 AM: ​
10:29:25 AM: ────────────────────────────────────────────────────────────────
10:29:25 AM:   3. Deploy site                                                
10:29:25 AM: ────────────────────────────────────────────────────────────────
10:29:25 AM: ​
10:29:25 AM: Starting to deploy site from 'dist'
10:29:25 AM: Creating deploy tree 
10:29:25 AM: Creating deploy upload records
10:29:25 AM: 21 new files to upload
10:29:25 AM: 1 new functions to upload
10:29:31 AM: Site deploy was successfully initiated
10:29:31 AM: ​
10:29:31 AM: (Deploy site completed in 6.2s)
10:29:31 AM: ​
10:29:31 AM: ────────────────────────────────────────────────────────────────
10:29:31 AM:   Netlify Build Complete                                        
10:29:31 AM: ────────────────────────────────────────────────────────────────
10:29:31 AM: ​
10:29:31 AM: (Netlify Build completed in 25.9s)
10:29:31 AM: Starting post processing
10:29:31 AM: Post processing - HTML
10:29:31 AM: Caching artifacts
10:29:31 AM: Started saving node modules
10:29:31 AM: Finished saving node modules
10:29:31 AM: Started saving build plugins
10:29:31 AM: Finished saving build plugins
10:29:31 AM: Started saving yarn cache
10:29:31 AM: Processing form - contactus
10:29:31 AM: Detected form fields:
 - firstname
 - lastname
 - email
 - phone
 - howcanwehelp
 - howdidyouhearaboutus
10:29:31 AM: Post processing - header rules
10:29:31 AM: Post processing - redirect rules
10:29:32 AM: Post processing done
10:29:35 AM: Finished saving yarn cache
10:29:35 AM: Started saving pip cache
10:29:35 AM: Finished saving pip cache
10:29:35 AM: Started saving emacs cask dependencies
10:29:35 AM: Finished saving emacs cask dependencies
10:29:35 AM: Started saving maven dependencies
10:29:35 AM: Finished saving maven dependencies
10:29:35 AM: Started saving boot dependencies
10:29:35 AM: Finished saving boot dependencies
10:29:35 AM: Started saving rust rustup cache
10:29:35 AM: Finished saving rust rustup cache
10:29:35 AM: Started saving go dependencies
10:29:35 AM: Site is live ✨
10:29:38 AM: Finished saving go dependencies
10:29:38 AM: Build script success
10:29:41 AM: Uploading Cache of size 695.3MB
10:29:45 AM: Finished processing build request in 1m4.084590009s

==== edit

I read somewhere netlify is not using the EDGE Network by default. So added the following preset:

nitro: {
    preset: 'netlify-edge',
  },

Now I receive another error:

Summary
3:15:10 PM:   2. Edge Functions bundling                                    
3:15:10 PM: ────────────────────────────────────────────────────────────────
3:15:10 PM: ​
3:15:10 PM: Packaging Edge Functions from .netlify/edge-functions directory:
3:15:10 PM:  - server
3:15:14 PM: ​
3:15:14 PM: ────────────────────────────────────────────────────────────────
3:15:14 PM:   Internal error during "Edge Functions bundling"               
3:15:14 PM: ────────────────────────────────────────────────────────────────
3:15:14 PM: ​
3:15:14 PM:   Error message
3:15:14 PM:   Error: [
3:15:14 PM:     {
3:15:14 PM:       "instancePath": "/routes/0/pattern",
3:15:14 PM:       "schemaPath": "#/properties/routes/items/properties/pattern/errorMessage",
3:15:14 PM:       "keyword": "errorMessage",
3:15:14 PM:       "params": {
3:15:14 PM:         "errors": [
3:15:14 PM:           {
3:15:14 PM:             "instancePath": "/routes/0/pattern",
3:15:14 PM:             "schemaPath": "#/properties/routes/items/properties/pattern/format",
3:15:14 PM:             "keyword": "format",
3:15:14 PM:             "params": {
3:15:14 PM:               "format": "regexPattern"
3:15:14 PM:             },
3:15:14 PM:             "message": "must match format \"regexPattern\"",
3:15:14 PM:             "emUsed": true
3:15:14 PM:           }
3:15:14 PM:         ]
3:15:14 PM:       },
3:15:14 PM:       "message": "must match format /^\\^.*\\$$/"
3:15:14 PM:     }
3:15:14 PM:   ]
3:15:14 PM: ​
3:15:14 PM:   Error location
3:15:14 PM:   During Edge Functions bundling
3:15:14 PM:       at validateEdgeFunctionsManifest (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.js:85:11)
3:15:14 PM:       at async coreStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins_core/edge_functions/index.js:70:3)
3:15:14 PM:       at async fireCoreStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/core_step.js:40:9)
3:15:14 PM:       at async tFireStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/time/main.js:20:59)
3:15:14 PM:       at async runStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/run_step.js:88:7)
3:15:14 PM:       at async pReduce.index (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/run_steps.js:91:11)
3:15:14 PM:       at async Promise.all (index 0)
3:15:14 PM:       at async next (file:///opt/buildhome/node-deps/node_modules/p-reduce/index.js:15:44)
3:15:14 PM: ​
3:15:14 PM:   Resolved config
3:15:14 PM:   build:
3:15:14 PM:     command: yarn build
3:15:14 PM:     commandOrigin: ui
3:15:14 PM:     environment:
3:15:14 PM:       - CONTENT_VERSION
3:15:14 PM:       - SSR
3:15:14 PM:       - STORYBLOK_API_KEY
3:15:14 PM:       - STORYBLOK_SPACE
3:15:14 PM:     publish: /opt/build/repo/dist
3:15:14 PM:     publishOrigin: ui
3:15:15 PM: Caching artifacts
3:15:15 PM: Started saving node modules

Hope you guys can help me :wink:

Thanks.

Just to clarify, based on the conversation that we had in the helpdesk, I thought you were trying to use Edge Functions because you know the regular functions will be slower. That’s what you even said:

Because the netlify-edge preset was the way I tried to reduce the initial server response time.

I read that response as, Netlify preset is working, but it’s slow and Edge Functions preset it not working - so to increase the speed, I want to use Edge Function preset. But then you clarified that you were asking only about the initial response time.

About that, unfortunately, this is almost expected behaviour. Unlike Edge Functions, Netlify Functions are locked to a single region - and are easily affected by cold-start issues. So, if your site doesn’t receive continuous traffic, a first visit after some time can take up to 2 seconds in some cases. However, any subsequent loads take as much as 500 ms - in my testing.

If you’re seeing times slower than that, feel free to share a HAR file recording.

Thanks for the response. As you suggested in the support I created an issue on GitHub. This one got fixed. Therefore I am now able to deploy on the Edge with NEtlify. Sadly Netlify throws an error in the logs when trying to access the corresponding site. (Already commented that on GitHub too, but maybe you can help though!)

8:48:50 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:48:50 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:04 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:16 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:16 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:25 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:25 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:39 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
8:50:39 AM: TypeError: Cannot read properties of undefined (reading '__EXTEND_POINT__')
    at file:///root/.netlify/edge-functions/server.js:1:509366
1 Like

Hi @rxs

That’s the first time I’m seeing that error. On a quick search I’m led to this resource:

Do you happen to be using any of this?

1 Like