Nextjs 14.2.5 and Runtime v5 server-rendered on demand instead of prerendered as static html/content

Hi all,

I’m using Nextjs 14.2.5 and the Nextjs Runtime v5 to build my website. As you can see in the build logs almost all of the pages/files are dynamically build at request time. I am hoping to get advice on how to get the following pages to be pre-rendered as a static page, which they already could’ve been as far as I understand nextjs and how netlify handles the framework.

Many thanks in advance !

Should be pre-rendered as static content at build time:

  • [locale]
  • [locale]/apropos
  • [locale]/shop
  • [locale]/shop/[slug]
  • [locale]/aide

Here’s the pubilc github repo: GitHub - weiyolan/nu-site
Below the build logs:

9:51:11 PM: build-image version: ecdc8b770f4a0193fd3f258c1bc6029e681813a4 (focal)
9:51:11 PM: buildbot version: 244d5322c7eb13029c1d65f78393f886c2e07fdb
9:51:11 PM: Fetching cached dependencies
9:51:12 PM: Starting to download cache of 508.1MB
9:51:13 PM: Finished downloading cache in 1.422s
9:51:13 PM: Starting to extract cache
9:51:19 PM: Finished extracting cache in 6.017s
9:51:19 PM: Finished fetching cache in 7.534s
9:51:19 PM: Starting to prepare the repo for build
9:51:19 PM: Preparing Git Reference refs/heads/main
9:51:22 PM: Starting to install dependencies
9:51:22 PM: Python version set to 3.8
9:51:22 PM: Attempting Ruby version 2.7.2, read from environment
9:51:23 PM: Using Ruby version 2.7.2
9:51:24 PM: Started restoring cached go cache
9:51:24 PM: Finished restoring cached go cache
9:51:25 PM: go version go1.19.13 linux/amd64
9:51:26 PM: Using PHP version 8.0
9:51:27 PM: Started restoring cached Node.js version
9:51:28 PM: Finished restoring cached Node.js version
9:51:28 PM: v18.20.4 is already installed.
9:51:29 PM: Now using node v18.20.4 (npm v10.7.0)
9:51:29 PM: Enabling Node.js Corepack
9:51:29 PM: Started restoring cached build plugins
9:51:29 PM: Finished restoring cached build plugins
9:51:29 PM: Started restoring cached corepack dependencies
9:51:29 PM: Finished restoring cached corepack dependencies
9:51:29 PM: No npm workspaces detected
9:51:29 PM: Started restoring cached node modules
9:51:29 PM: Finished restoring cached node modules
9:51:29 PM: Installing npm packages using npm version 10.7.0
9:51:31 PM: npm warn ERESOLVE overriding peer dependency
9:51:31 PM: npm warn While resolving: react-props-stream@1.0.1
9:51:31 PM: npm warn Found: rxjs@7.8.1
9:51:31 PM: npm warn node_modules/rxjs
9:51:31 PM: npm warn   rxjs@"^7.0.0" from @sanity/bifur-client@0.4.1
9:51:31 PM: npm warn   node_modules/@sanity/bifur-client
9:51:31 PM: npm warn     @sanity/bifur-client@"^0.4.0" from sanity@3.47.1
9:51:31 PM: npm warn     node_modules/sanity
9:51:31 PM: npm warn   12 more (@sanity/client, @sanity/dashboard, @sanity/util, ...)
9:51:31 PM: npm warn
9:51:31 PM: npm warn Could not resolve dependency:
9:51:31 PM: npm warn peer rxjs@"^6" from react-props-stream@1.0.1
9:51:31 PM: npm warn node_modules/react-props-stream
9:51:31 PM: npm warn   react-props-stream@"^1.0.1" from sanity-plugin-dashboard-widget-netlify@2.0.1
9:51:31 PM: npm warn   node_modules/sanity-plugin-dashboard-widget-netlify
9:51:31 PM: npm warn
9:51:31 PM: npm warn Conflicting peer dependency: rxjs@6.6.7
9:51:31 PM: npm warn node_modules/rxjs
9:51:31 PM: npm warn   peer rxjs@"^6" from react-props-stream@1.0.1
9:51:31 PM: npm warn   node_modules/react-props-stream
9:51:31 PM: npm warn     react-props-stream@"^1.0.1" from sanity-plugin-dashboard-widget-netlify@2.0.1
9:51:31 PM: npm warn     node_modules/sanity-plugin-dashboard-widget-netlify
9:51:31 PM: npm warn ERESOLVE overriding peer dependency
9:51:31 PM: npm warn While resolving: @sanity/icons@3.2.0
9:51:31 PM: npm warn Found: react@18.2.0
9:51:31 PM: npm warn node_modules/react
9:51:31 PM: npm warn   react@"^18" from the root project
9:51:31 PM: npm warn   132 more (@dnd-kit/accessibility, @dnd-kit/core, ...)
9:51:31 PM: npm warn
9:51:31 PM: npm warn Could not resolve dependency:
9:51:31 PM: npm warn peer react@"^18.3 || >=19.0.0-rc" from @sanity/icons@3.2.0
9:51:31 PM: npm warn node_modules/@sanity/ui/node_modules/@sanity/icons
9:51:31 PM: npm warn   @sanity/icons@"^3.2.0" from @sanity/ui@2.4.0
9:51:31 PM: npm warn   node_modules/@sanity/ui
9:51:31 PM: npm warn
9:51:31 PM: npm warn Conflicting peer dependency: react@18.3.1
9:51:31 PM: npm warn node_modules/react
9:51:31 PM: npm warn   peer react@"^18.3 || >=19.0.0-rc" from @sanity/icons@3.2.0
9:51:31 PM: npm warn   node_modules/@sanity/ui/node_modules/@sanity/icons
9:51:31 PM: npm warn     @sanity/icons@"^3.2.0" from @sanity/ui@2.4.0
9:51:31 PM: npm warn     node_modules/@sanity/ui
9:51:31 PM: npm warn ERESOLVE overriding peer dependency
9:51:31 PM: npm warn While resolving: @sanity/icons@3.2.0
9:51:31 PM: npm warn Found: react@18.2.0
9:51:31 PM: npm warn node_modules/react
9:51:31 PM: npm warn   react@"^18" from the root project
9:51:31 PM: npm warn   132 more (@dnd-kit/accessibility, @dnd-kit/core, ...)
9:51:31 PM: npm warn
9:51:31 PM: npm warn Could not resolve dependency:
9:51:31 PM: npm warn peer react@"^18.3 || >=19.0.0-rc" from @sanity/icons@3.2.0
9:51:31 PM: npm warn node_modules/sanity/node_modules/@sanity/icons
9:51:31 PM: npm warn   @sanity/icons@"^3.0.0" from sanity@3.47.1
9:51:31 PM: npm warn   node_modules/sanity
9:51:31 PM: npm warn   1 more (@sanity/insert-menu)
9:51:31 PM: npm warn
9:51:31 PM: npm warn Conflicting peer dependency: react@18.3.1
9:51:31 PM: npm warn node_modules/react
9:51:31 PM: npm warn   peer react@"^18.3 || >=19.0.0-rc" from @sanity/icons@3.2.0
9:51:31 PM: npm warn   node_modules/sanity/node_modules/@sanity/icons
9:51:31 PM: npm warn     @sanity/icons@"^3.0.0" from sanity@3.47.1
9:51:31 PM: npm warn     node_modules/sanity
9:51:31 PM: npm warn     1 more (@sanity/insert-menu)
9:51:32 PM: npm warn ERESOLVE overriding peer dependency
9:51:32 PM: npm warn While resolving: @sanity/insert-menu@1.0.6
9:51:32 PM: npm warn Found: react@18.2.0
9:51:32 PM: npm warn node_modules/react
9:51:32 PM: npm warn   react@"^18" from the root project
9:51:32 PM: npm warn   132 more (@dnd-kit/accessibility, @dnd-kit/core, ...)
9:51:32 PM: npm warn
9:51:32 PM: npm warn Could not resolve dependency:
9:51:32 PM: npm warn peer react@"^18.3 || >=19.0.0-rc" from @sanity/insert-menu@1.0.6
9:51:32 PM: npm warn node_modules/sanity/node_modules/@sanity/insert-menu
9:51:32 PM: npm warn   @sanity/insert-menu@"1.0.6" from sanity@3.47.1
9:51:32 PM: npm warn   node_modules/sanity
9:51:32 PM: npm warn
9:51:32 PM: npm warn Conflicting peer dependency: react@18.3.1
9:51:32 PM: npm warn node_modules/react
9:51:32 PM: npm warn   peer react@"^18.3 || >=19.0.0-rc" from @sanity/insert-menu@1.0.6
9:51:32 PM: npm warn   node_modules/sanity/node_modules/@sanity/insert-menu
9:51:32 PM: npm warn     @sanity/insert-menu@"1.0.6" from sanity@3.47.1
9:51:32 PM: npm warn     node_modules/sanity
9:51:32 PM: npm warn ERESOLVE overriding peer dependency
9:51:32 PM: npm warn While resolving: @sanity/insert-menu@1.0.6
9:51:32 PM: npm warn Found: react-dom@18.2.0
9:51:32 PM: npm warn node_modules/react-dom
9:51:32 PM: npm warn   react-dom@"^18" from the root project
9:51:32 PM: npm warn   69 more (@dnd-kit/core, @floating-ui/react-dom, ...)
9:51:32 PM: npm warn
9:51:32 PM: npm warn Could not resolve dependency:
9:51:32 PM: npm warn peer react-dom@"^18.3 || >=19.0.0-rc" from @sanity/insert-menu@1.0.6
9:51:32 PM: npm warn node_modules/sanity/node_modules/@sanity/insert-menu
9:51:32 PM: npm warn   @sanity/insert-menu@"1.0.6" from sanity@3.47.1
9:51:32 PM: npm warn   node_modules/sanity
9:51:32 PM: npm warn
9:51:32 PM: npm warn Conflicting peer dependency: react-dom@18.3.1
9:51:32 PM: npm warn node_modules/react-dom
9:51:32 PM: npm warn   peer react-dom@"^18.3 || >=19.0.0-rc" from @sanity/insert-menu@1.0.6
9:51:32 PM: npm warn   node_modules/sanity/node_modules/@sanity/insert-menu
9:51:32 PM: npm warn     @sanity/insert-menu@"1.0.6" from sanity@3.47.1
9:51:32 PM: npm warn     node_modules/sanity
9:51:32 PM: npm warn ERESOLVE overriding peer dependency
9:51:32 PM: npm warn While resolving: react-rx@3.1.1
9:51:32 PM: npm warn Found: react@18.2.0
9:51:32 PM: npm warn node_modules/react
9:51:32 PM: npm warn   react@"^18" from the root project
9:51:32 PM: npm warn   132 more (@dnd-kit/accessibility, @dnd-kit/core, ...)
9:51:32 PM: npm warn
9:51:32 PM: npm warn Could not resolve dependency:
9:51:32 PM: npm warn peer react@"^18.3 || >=19.0.0-rc" from react-rx@3.1.1
9:51:32 PM: npm warn node_modules/sanity/node_modules/react-rx
9:51:32 PM: npm warn   react-rx@"^3.0.0" from sanity@3.47.1
9:51:32 PM: npm warn   node_modules/sanity
9:51:32 PM: npm warn
9:51:32 PM: npm warn Conflicting peer dependency: react@18.3.1
9:51:32 PM: npm warn node_modules/react
9:51:32 PM: npm warn   peer react@"^18.3 || >=19.0.0-rc" from react-rx@3.1.1
9:51:32 PM: npm warn   node_modules/sanity/node_modules/react-rx
9:51:32 PM: npm warn     react-rx@"^3.0.0" from sanity@3.47.1
9:51:32 PM: npm warn     node_modules/sanity
9:51:32 PM: npm warn ERESOLVE overriding peer dependency
9:51:32 PM: npm warn While resolving: react-dom@17.0.2
9:51:32 PM: npm warn Found: react@18.2.0
9:51:32 PM: npm warn node_modules/react
9:51:32 PM: npm warn   react@"^18" from the root project
9:51:32 PM: npm warn   132 more (@dnd-kit/accessibility, @dnd-kit/core, ...)
9:51:32 PM: npm warn
9:51:32 PM: npm warn Could not resolve dependency:
9:51:32 PM: npm warn peer react@"17.0.2" from react-dom@17.0.2
9:51:32 PM: npm warn node_modules/use-shopping-cart/node_modules/react-dom
9:51:32 PM: npm warn   react-dom@"^17.0.2" from use-shopping-cart@3.2.0
9:51:32 PM: npm warn   node_modules/use-shopping-cart
9:51:32 PM: npm warn
9:51:32 PM: npm warn Conflicting peer dependency: react@17.0.2
9:51:32 PM: npm warn node_modules/react
9:51:32 PM: npm warn   peer react@"17.0.2" from react-dom@17.0.2
9:51:32 PM: npm warn   node_modules/use-shopping-cart/node_modules/react-dom
9:51:32 PM: npm warn     react-dom@"^17.0.2" from use-shopping-cart@3.2.0
9:51:32 PM: npm warn     node_modules/use-shopping-cart
9:51:36 PM: up to date, audited 1493 packages in 7s
9:51:36 PM: 244 packages are looking for funding
9:51:36 PM:   run `npm fund` for details
9:51:36 PM: 16 vulnerabilities (5 moderate, 5 high, 6 critical)
9:51:36 PM: To address issues that do not require attention, run:
9:51:36 PM:   npm audit fix
9:51:36 PM: To address all issues possible (including breaking changes), run:
9:51:36 PM:   npm audit fix --force
9:51:36 PM: Some issues need review, and may require choosing
9:51:36 PM: a different dependency.
9:51:36 PM: Run `npm audit` for details.
9:51:36 PM: npm packages installed
9:51:37 PM: Successfully installed dependencies
9:51:37 PM: Starting build script
9:51:38 PM: Detected 1 framework(s)
9:51:38 PM: "next" at version "14.2.5"
9:51:38 PM: Section completed: initializing
9:51:40 PM: ​
9:51:40 PM: Netlify Build                                                 
9:51:40 PM: ────────────────────────────────────────────────────────────────
9:51:40 PM: ​
9:51:40 PM: ❯ Version
9:51:40 PM:   @netlify/build 29.54.3
9:51:40 PM: ​
9:51:40 PM: ❯ Flags
9:51:40 PM:   accountId: 63219b2b2f25e26b0bb384c6
9:51:40 PM:   baseRelDir: true
9:51:40 PM:   buildId: 66ef239f90ea380008034c85
9:51:40 PM:   deployId: 66ef239f90ea380008034c87
9:51:40 PM: ​
9:51:40 PM: ❯ Current directory
9:51:40 PM:   /opt/build/repo
9:51:40 PM: ​
9:51:40 PM: ❯ Config file
9:51:40 PM:   No config file was defined: using default values.
9:51:40 PM: ​
9:51:40 PM: ❯ Context
9:51:40 PM:   production
9:51:40 PM: ​
9:51:40 PM: ❯ Using Next.js Runtime - v5.7.2
9:51:42 PM: Next.js cache restored
9:51:42 PM: ​
9:51:42 PM: Build command from Netlify app                                
9:51:42 PM: ────────────────────────────────────────────────────────────────
9:51:42 PM: ​
9:51:42 PM: $ next build
9:51:43 PM:   ▲ Next.js 14.2.5
9:51:43 PM:    Creating an optimized production build ...
9:51:59 PM:  ✓ Compiled successfully
9:51:59 PM:    Skipping validation of types
9:51:59 PM:    Linting ...
9:52:03 PM: ./src/app/[locale]/(site)/return/page.tsx
9:52:03 PM: 49:6  Warning: React Hook useEffect has a missing dependency: 'clearCart'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
9:52:03 PM: ./src/components/shoppingCart/Checkout.tsx
9:52:03 PM: 48:6  Warning: React Hook useCallback has missing dependencies: 'cartDetails', 'locale', 'session?.user?.email', and 'session?.user?.id'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
9:52:03 PM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
9:52:03 PM:    Collecting page data ...
9:52:10 PM:    Generating static pages (0/29) ...
9:52:11 PM:    Generating static pages (7/29)
9:52:11 PM:    Generating static pages (14/29)
9:52:11 PM:    Generating static pages (21/29)
9:52:12 PM:  ✓ Generating static pages (29/29)
9:52:18 PM:    Finalizing page optimization ...
9:52:18 PM:    Collecting build traces ...
9:52:28 PM: Route (app)                                                   Size     First Load JS
9:52:28 PM: ┌ ƒ /_not-found                                               879 B          88.6 kB
9:52:28 PM: ├ ƒ /[locale]                                                 2.47 kB         172 kB
9:52:28 PM: ├ ƒ /[locale]/account                                         156 B          87.9 kB
9:52:28 PM: ├ ƒ /[locale]/account/manage                                  3.06 kB         115 kB
9:52:28 PM: ├ ƒ /[locale]/account/orders                                  11.2 kB         152 kB
9:52:28 PM: ├ ƒ /[locale]/account/page-links                              1.33 kB         175 kB
9:52:28 PM: ├ ƒ /[locale]/account/page-links/[pageLinkId]                 662 B           174 kB
9:52:28 PM: ├ ƒ /[locale]/account/pages                                   4.9 kB          156 kB
9:52:28 PM: ├ ƒ /[locale]/account/pages/[pageId]                          3.93 kB         177 kB
9:52:28 PM: ├ ƒ /[locale]/account/pages/[pageId]/page-links/[pageLinkId]  662 B           174 kB
9:52:28 PM: ├ ƒ /[locale]/account/resend                                  1.43 kB         124 kB
9:52:28 PM: ├ ƒ /[locale]/account/settings                                2.33 kB        98.2 kB
9:52:28 PM: ├ ƒ /[locale]/aide                                            874 B           120 kB
9:52:28 PM: ├ ƒ /[locale]/apropos                                         4.17 kB         131 kB
9:52:28 PM: ├ ƒ /[locale]/return                                          4.71 kB         127 kB
9:52:28 PM: ├ ƒ /[locale]/shop                                            2.88 kB         167 kB
9:52:28 PM: ├ ● /[locale]/shop/[slug]                                     7.06 kB         190 kB
9:52:28 PM: ├   ├ /fr/shop/nyx
9:52:28 PM: ├   ├ /fr/shop/boite-savon
9:52:28 PM: ├   ├ /fr/shop/le-pack-total
9:52:28 PM: ├   └ [+9 more paths]
9:52:28 PM: ├ ƒ /[locale]/sign-in                                         2.34 kB         116 kB
9:52:28 PM: ├ ƒ /[locale]/sign-up                                         2.34 kB         116 kB
9:52:28 PM: ├ ƒ /api/account                                              0 B                0 B
9:52:28 PM: ├ ƒ /api/billing/buy-product                                  0 B                0 B
9:52:28 PM: ├ ƒ /api/billing/checkout                                     0 B                0 B
9:52:28 PM: ├ ƒ /api/billing/manage-subscription                          0 B                0 B
9:52:28 PM: ├ ƒ /api/email/registered                                     0 B                0 B
9:52:28 PM: ├ ƒ /api/orders                                               0 B                0 B
9:52:28 PM: ├ ƒ /api/pageLinks                                            0 B                0 B
9:52:28 PM: ├ ƒ /api/pages                                                0 B                0 B
9:52:28 PM: ├ ƒ /api/sign-in                                              0 B                0 B
9:52:28 PM: ├ ƒ /api/sign-out                                             0 B                0 B
9:52:28 PM: ├ ƒ /api/sign-up                                              0 B                0 B
9:52:28 PM: ├ ƒ /api/trpc/[trpc]                                          0 B                0 B
9:52:28 PM: ├ ƒ /api/webhooks/stripe                                      0 B                0 B
9:52:28 PM: ├ ○ /sitemap.xml                                              0 B                0 B
9:52:28 PM: └ ƒ /studio/[[...index]]                                      1.29 MB        1.43 MB
9:52:28 PM: + First Load JS shared by all                                 87.7 kB
9:52:28 PM:   ├ chunks/7023-2155c3902e07c26a.js                           31.7 kB
9:52:28 PM:   ├ chunks/fd9d1056-df6df97f7a042d34.js                       53.6 kB
9:52:28 PM:   └ other shared chunks (total)                               2.4 kB
9:52:28 PM: ƒ Middleware                                                  33.9 kB
9:52:28 PM: ○  (Static)   prerendered as static content
9:52:28 PM: ●  (SSG)      prerendered as static HTML (uses getStaticProps)
9:52:28 PM: ƒ  (Dynamic)  server-rendered on demand
9:52:28 PM: ​
9:52:28 PM: (build.command completed in 46.1s)
9:52:29 PM: Next.js cache saved
9:52:30 PM: ​
9:52:30 PM: Functions bundling                                            
9:52:30 PM: ────────────────────────────────────────────────────────────────
9:52:30 PM: ​
9:52:30 PM: Packaging Functions from .netlify/functions-internal directory:
9:52:30 PM:  - ___netlify-server-handler/___netlify-server-handler.mjs
9:52:30 PM: ​
9:52:31 PM: ​
9:52:31 PM: (Functions bundling completed in 1.5s)
9:52:31 PM: ​
9:52:31 PM: Edge Functions bundling                                       
9:52:31 PM: ────────────────────────────────────────────────────────────────
9:52:31 PM: ​
9:52:31 PM: Packaging Edge Functions from .netlify/edge-functions directory:
9:52:31 PM:  - ___netlify-edge-handler-src-middleware
9:52:32 PM: ​
9:52:32 PM: (Edge Functions bundling completed in 1.1s)
9:52:33 PM: ​
9:52:33 PM: Deploy site                                                   
9:52:33 PM: ────────────────────────────────────────────────────────────────
9:52:33 PM: ​
9:52:33 PM: Starting to deploy site from '.next'
9:52:33 PM: Calculating files to upload
9:52:33 PM: 0 new file(s) to upload
9:52:33 PM: 1 new function(s) to upload
9:52:40 PM: Post processing - header rules
9:52:40 PM: Starting post processing
9:52:40 PM: Skipping form detection
9:52:40 PM: Post processing - redirect rules
9:52:40 PM: Post processing done
9:52:40 PM: Section completed: postprocessing
9:52:40 PM: Section completed: deploying
9:52:41 PM: Site is live ✨
9:52:42 PM: Finished waiting for live deploy in 2.049s
9:52:42 PM: Site deploy was successfully initiated
9:52:42 PM: ​
9:52:42 PM: (Deploy site completed in 9.2s)
9:52:44 PM: ​
9:52:44 PM: Netlify Build Complete                                        
9:52:44 PM: ────────────────────────────────────────────────────────────────
9:52:44 PM: ​
9:52:44 PM: (Netlify Build completed in 1m 4.8s)
9:52:45 PM: Caching artifacts
9:52:45 PM: Started saving node modules
9:52:45 PM: Finished saving node modules
9:52:45 PM: Started saving build plugins
9:52:45 PM: Finished saving build plugins
9:52:45 PM: Started saving corepack cache
9:52:45 PM: Finished saving corepack cache
9:52:45 PM: Started saving pip cache
9:52:45 PM: Finished saving pip cache
9:52:45 PM: Started saving emacs cask dependencies
9:52:45 PM: Finished saving emacs cask dependencies
9:52:45 PM: Started saving maven dependencies
9:52:45 PM: Finished saving maven dependencies
9:52:45 PM: Started saving boot dependencies
9:52:45 PM: Finished saving boot dependencies
9:52:45 PM: Started saving rust rustup cache
9:52:45 PM: Finished saving rust rustup cache
9:52:45 PM: Started saving go dependencies
9:52:45 PM: Finished saving go dependencies
9:52:45 PM: Build script success
9:52:45 PM: Section completed: building
9:52:49 PM: Uploading Cache of size 501.8MB
9:52:51 PM: Section completed: cleanup
9:52:51 PM: Finished processing build request in 1m39.409s

The output is generated by Next.js, not Netlify. You should check Next.js docs or ask on Next.js forums on how to prerender these pages.