PANE

Next.js developers face build failures with empty generateStaticParams

42 posts across 2 communities since Apr 2021; 98% from GitHub.

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/heuristic hooks cndpsr To Reproduce The CodeSandbox from NextJS to create minimal reproductions is broken, so my linked sandbox is too use the output: export config, create a page with a dynamic path…”
GitHub
“Link to the code that reproduces this issue https://github.com/ledbetterljoshua/link bug reproduction To Reproduce Live Demo https://link bug reproduction.vercel.app/ Repository https://github.com/ledbetterljoshua/link bug reproduction Steps to reproduce 1. Start on the home…”
GitHub
“Link to the code that reproduces this issue or a replay of the bug https://github.com/nickderobertis ch/app ssg i18n issue To Reproduce 1. Run next build, observe error. Current vs. Expected behavior I expected the build to complete successfully with statically generated pages…”
GitHub

Developers using Next.js are encountering build errors when the `generateStaticParams` function returns an empty array, specifically impacting dynamic pages and requiring at least one parameter to succeed.

devtoolsainextjswebdev
FIT
0%
SIGNAL
89%
SOURCES42
FRESHEST POSTAUG 20
TRACKED SINCE63D AGO

SOURCES (42)

“[unanswered, 29 views] More info: Next.js 16, App Router Local build and dev worked fine Uses default Next.js GitHub action, fails at build: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error Error: Couldn't find next-intl config file. Please follow the instructions at https://next-intl.dev/docs/getting-started/app-router at m…”

STACK EXCHANGECC BY-SA 4.0Aug 20

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/heuristic hooks cndpsr To Reproduce The CodeSandbox from NextJS to create minimal reproductions is broken, so my linked sandbox is too use the output: export config, create a page with a dynamic path: /assessment/results/[id]/page.tsx add these contents: Run dev server and visit http://localhost:3000/assessment/results/6 Current vs. Expected behavior it should render the page dynamically, instead I get the following erro”

GITHUBDec 2024

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/fl4vdz To Reproduce 1. open codesandbox 2. run build and then prod mode server 3. visit the root / in preview and hit "NAVIGATE" 4. observe that the loaded page has a blank result value and the ref is set to "done" <img width="438" alt="image" src="https://github.com/user attachments/assets/e1170fed 3135 49cb bbec 7c54aee1cac8" Current vs. Expected behavior From everything I can find online, a component should not retain”

GITHUBDec 2024

“Link to the code that reproduces this issue https://github.com/ledbetterljoshua/link bug reproduction To Reproduce Live Demo https://link bug reproduction.vercel.app/ Repository https://github.com/ledbetterljoshua/link bug reproduction Steps to reproduce 1. Start on the home page (App Router) 2. Click any of the "pages route" links 3. Observe that regardless of which link you click, you always get the query parameter from the first link ( link=1 ) Current vs. Expected behavior Current behavior E”

GITHUBNov 2024

“Link to the code that reproduces this issue https://github.com/mauron85/nextjs webpack assets To Reproduce 1. create plain nextjs app or pull example from https://github.com/mauron85/nextjs webpack assets 2. add simple asset log plugin // next.config.js 3. run npm run build 4. compare file names in .next\static\chunks\pages\[sessionId] vs what plugin reported Current vs. Expected behavior When building a Next.js application, the assets listed by Webpack (such as those logged by plugins like File”

GITHUBNov 2024

“Link to the code that reproduces this issue https://github.com/NasserBvB/generate static params issue To Reproduce While building a Next.js application with output: "export" in next.config.js , I encountered an error regarding the missing generateStaticParams() function, despite it being implemented and returning an empty list. This error specifically affects dynamic pages in the project. Notably, the build succeeds as expected when generateStaticParams() returns at least one article parameter i”

GITHUBOct 2024

“Link to the code that reproduces this issue https://github.com/GuiBibeau/react router nextapp reproduction To Reproduce While following the tutorial to migrate from a Vite SPA (with react router), I am able to build and render the application but hot reloading does not work. 1. clone repo, install dependency and start dev server 2. navigate to home page http://localhost:3000/ 3. Click on Data 1 link on the home page, SPA behavior will work as expected 4. refresh page or trigger hot reloading, pa”

GITHUBSep 2024

“Link to the code that reproduces this issue https://github.com/Floriferous/next api bug To Reproduce Clone this repo: https://github.com/Floriferous/next api bug Run it with npm run dev Visit '/' with your browser Notice the error r is not a function in the terminal When you remove 'use server', the API route starts working again Current vs. Expected behavior This is a reopening of 67833, as I was still experiencing the bug even after doing what @icyJoseph suggested. The issue is more complex, a”

GITHUBAug 2024

“Link to the code that reproduces this issue https://github.com/ekerik220/global error debug To Reproduce 1. Start the application in production mode (pnpm build pnpm start). 2. Refresh the page until an error occurs (50% chance). 3. Press the 'Try again' button. A new error should appear (Cannot read properties of null (reading 'get')). Current vs. Expected behavior Following the above steps, I expected the app to be re rendered (possibly encountering the 50% chance error again and therefore cau”

GITHUBJun 2024

“Link to the code that reproduces this issue https://github.com/veract dev/prahars.git To Reproduce nextjs.config blog/[slug]/page.tsx Current vs. Expected behavior Current behavior in npm build files are not generated for id with value Expected behavior to build files and generate Provide environment information Which area(s) are affected? (Select all that apply) Not sure Which stage(s) are affected? (Select all that apply) next build (local) Additional context updated code is in master branch”

GITHUBMay 2024

“Link to the code that reproduces this issue https://github.com/EvgeniyBudaev/base docker go next/tree/main/web To Reproduce 1) npx create next app@latest 2) go to page.tsx Screenshot209 Current vs. Expected behavior Current behavior: eslint error Expected behavior: No eslint error Provide environment information Which area(s) are affected? (Select all that apply) Linting Which stage(s) are affected? (Select all that apply) next dev (local) Additional context No response”

GITHUBApr 2024
Source preview · github.com

Link to the code that reproduces this issue https://github.com/Javad9s/nextjs revalidate breaks static params To Reproduce 1. Build and start the application ( npm run build , npm start ) 2. Open http://localhost:3000/params/01…

github.comMar 2024

“Link to the code that reproduces this issue https://github.com/nobu sh/next js 14 caching test To Reproduce This is a re open of https://github.com/vercel/next.js/issues/58723. It was supposedly fixed in PR https://github.com/vercel/next.js/pull/61573 which would have shown up in v14.1.1 canary.64 but it is still very much an issue in v14.1.3. I updated the reproduction code to the latest release. I found an error with Router Cache. This app works fine initially: Server Component's RSC Payload s”

GITHUBMar 2024

“Link to the code that reproduces this issue https://github.com/Innei/nextjs catch all static output reproduction To Reproduce The code: 1. run build log: Current vs. Expected behavior current: Build crash Expected: Should static output Provide environment information Which area(s) are affected? (Select all that apply) App Router Which stage(s) are affected? (Select all that apply) next build (local) Additional context I found some related issues, but they're not the same 61213 58171 <sub NEXT 27”

GITHUBFeb 2024

“Link to the code that reproduces this issue https://github.com/morganwestcoding/forme nextjs To Reproduce I'm encountering an error when attempting to build my Next.js application with Docker. The build process fails during the prerendering of pages, citing issues with useSearchParams() not being wrapped in a suspense boundary and prerender errors on several pages. Steps to Reproduce : 1. Clone the repo: https://github.com/morganwestcoding/forme nextjs 2. Run npm install 3. Start the development”

GITHUBFeb 2024

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/compassionate wilson qcxws4?file=%2Fapp%2Ffoo%2F%5Bslug%5D%2Fpage.tsx%3A12%2C47 To Reproduce 1. See that the file in app/foo/[slug]/page.tsx has a generateStaticParams function that returns an empty array, and there are two possible ways to build the app, one with output: 'export' ( npm run build:export ) and one with output: undefined ( npm run build:ssr ) 2. Try npm run build:export and see that it fails with the error”

GITHUBJan 2024

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/component composition bug next yjv4fr?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL GROUP%2522%252C%2522id%2522%253A%2522ROOT LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL GROUP%2522%252C%2522contentType%2522%253A%25”

GITHUBJan 2024

“Link to the code that reproduces this issue https://github.com/pedro757/redirect issue client components To Reproduce 1. Click the button Current vs. Expected behavior Currently it's not redirecting to the otherpage I expect to actually redirect to the otherpage Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) are affected? (Select all that apply) App Router, Routing (next/router, next/navigation, next/l”

GITHUBDec 2023

“Link to the code that reproduces this issue https://github.com/meds/nextjs broken export To Reproduce 1. Run pnpm build Current vs. Expected behavior I expected nextjs to build and export to an output directory with static files. Instead I got an error: Error: Page "/test/[id]" is missing "generateStaticParams()" so it cannot be used with "output: export" config. Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which”

GITHUBNov 2023
Source preview · github.com

Link to the code that reproduces this issue https://github.com/capJavert/nextjs functions break dynamic routes To Reproduce 1. Add serverless function with custom runtime (eg. Go) to your Next.js project 2. Add dynamic API…

github.comOct 2023

“Link to the code that reproduces this issue or a replay of the bug https://github.com/nickderobertis ch/app ssg i18n issue To Reproduce 1. Run next build, observe error. Current vs. Expected behavior I expected the build to complete successfully with statically generated pages for each of the values returned in generateStaticParams . Instead, the build fails with the following output: Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environm”

GITHUBSep 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue or a replay of the bug https://github.com/andrewgolovanov/reproduction app To Reproduce Steps for testing: 1. Deploy the reproduction app repository to Vercel. Note : This issue doesn't manifest locally or with the Vercel CLI. 2. Navigate to https://<yo”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue or a replay of the bug https://github.com/AaronVr/nextjs client component bug To Reproduce 1. Start with the base Next.js project with default settings 2. Create a new file called app/counter.tsx 3. Create the following client component within app/count”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router, ESLint (eslint config next), TypeScript (plugin, built in types) Link to the code that reproduces this issue or a replay of the bug N/a To Reproduce Create a page.tsx file in the app dir with a default export for the page, and a named export to represent any util function. Describe the Bug Previo”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information NOTE: 13.4.12 is the most recent version I could run, all 13.4.13 canaries are crashing with the following error: Which area(s) of Next.js are affected? (leave empty if unsure) App Router Link to the code that reproduces this issue or a replay of the bug https://github.com/helloitsjoe/next custom server repro To Reproduce Please see the reproduction repo, it has a full”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router Link to the code that reproduces this issue or a replay of the bug https://codesandbox.io/p/sandbox/exciting hertz mx9zfh To Reproduce Define a optional segment (do not confuse with Optional Catch all Segments ): Run next dev and see the error: Describe the Bug I'm using i18n. The default locale i”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router Link to the code that reproduces this issue or a replay of the bug https://github.com/Bakon/nextjs generateBuildId issue To Reproduce npm i npm run build (or next build ) Inspect / make a screenshot of all the chunks inside .next/static/chunks npm run build (or next build ) Inspect all the chunks”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue or a replay of the bug https://github.com/tom sherman/nextjs template route group bug To Reproduce 1. Add a template in the same route as a route group 2. Navigate between pages in the group Describe the Bug Template should rerender. In the linked repro”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Internationalization (i18n), Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue or a replay of the bug https://codesandbox.io/p/sandbox/tender shannon ykkmm6?file=%2Fmiddleware.ts%3A4%2C1 To Reproduce 1. Open /en/fr url 2. Ch”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue https://github.com/Livog/next link app dir bug To Reproduce 1. Hard navigate to: http://localhost:3000/dynamic 2. Update the input and click submit (this will save the data to the body.json in root) 3. Click on Home”

GITHUBMay 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue Unable to provide To Reproduce 1. Follow install docs for nextjs supabase: https://supabase.com/docs/guides/auth/auth helpers/nextjs server components 2. add a generateStaticParams Describe the Bug Using generateStaticParams with supabase is causing an”

GITHUBMay 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue https://stackblitz.com/edit/vercel next js z4hyvr?file=README.md,server.js,package.json,app%2Fpage.tsx,next.config.js,server try catch.js To Reproduce Run the project with scripts "dev": "node server.js" and "dev try catch": "node server try catch.js" T”

GITHUBMar 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Routing (next/router, next/navigation, next/link), SSR Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/adoring goodall ibox0j?file=%2Fpages%2F%5B...anything%5D.tsx&selection=%5B%7B%22endColumn%22%3A1%2C%22endLineNumber%22%3A7%2C%22startColumn%22%3A1%2C%22startLineNumber%22%3A7%7D”

GITHUBMar 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: linux Arch: x64 Version: 22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.19 pnpm: 7.1.0 Relevant packages: next: 13.1.7 canary.15 eslint config next: 13.1.2 react: 18.2.0 react dom: 18.2.0 Which area(s) of Next.js are affected? (leave empty if unsure) App directory (appDir: true) Link to the code that reprod”

GITHUBFeb 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/suspicious haslett r6dhhh?file=%2Fpages%2Findex.tsx&selection=%5B%7B%22endColumn%22%3A1%2C%22endLineNumber%22%3A4%2C%22startColumn%22%3A1%2C%22startLineNumber%22%3A3%7D%5D To Reproduce Unable to reproduce in the sandbox”

GITHUBFeb 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu 8792.61.2 4/RELEASE ARM64 T6000 Binaries: Node: 16.18.1 npm: 8.19.2 Yarn: 3.2.1 pnpm: N/A Relevant packages: next: 13.0.7 eslint config next: N/A react: 18.2.0 react dom: 18.2.0 Which area(s) of Next.js are affected? (leave empty if unsure) App di”

GITHUBDec 2022

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information next 13 node 16 What browser are you using? (if relevant) No response How are you deploying your application? (if relevant) No response Describe the Bug I have a script that has a public location and I upload it like this <img width="849" alt="image" src="https://user images.githubusercontent.com/19804652/202509890 bf3d3c07 82aa 47b3 9ddd b2c937036d8d.png" after next bu”

GITHUBNov 2022

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu 8020.140.49 2/RELEASE X86 64 Binaries: Node: 16.15.0 npm: 8.5.5 Yarn: 1.22.15 pnpm: 6.11.0 Relevant packages: next: 13.0.1 canary.0 eslint config next: 13.0.0 react: 18.2.0 react dom: 18.2.0 What browser are you using? (if relevant) No response How”

GITHUBOct 2022

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information OS: MacOs Catalina OS version: 10.15.7 Browser: Google Chrome Browser version: 104.0.5112.101 Next.js version: 12.1.6 What browser are you using? (if relevant) Google Chrome How are you deploying your application? (if relevant) Plesk Describe the Bug Error code: 5 shows when I go through the app I'm building. This error only shows for google chrome for Mac image Expecte”

GITHUBAug 2022

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu 8020.121.3 4/RELEASE X86 64 Binaries: Node: 16.14.0 npm: 8.12.0 Yarn: 1.22.17 pnpm: 7.5.2 Relevant packages: next: 12.2.3 canary.15 eslint config next: 12.2.2 react: 18.2.0 react dom: 18.2.0 What browser are you using? (if relevant) No response How”

GITHUBJul 2022

“Run next info (available from version 12.0.8 and up) No response What version of Next.js are you using? 12.0.7 What version of Node.js are you using? 14.15.0 What browser are you using? Chrome What operating system are you using? MacOS How are you deploying your application? Custom server/Other platform Describe the Bug Experiencing intermittent 500s in production across all SSG pages with revalidation. When checking server logs, found this errror: Looking a little deeper into the render result”

GITHUBJan 2022

“What version of Next.js are you using? 10.0.5 What version of Node.js are you using? 12.13.0 What browser are you using? Brave What operating system are you using? macOS How are you deploying your application? next export S3 Describe the Bug I have a static site that I am deploying to an S3 bucket with npm run build && npm run export and I have trailingSlash: true set in my next config file. I am finding that if I go to a route on my localhost like so: http://localhost:3000/users/login?query=tes”

GITHUBApr 2021

SOLUTION LANDSCAPE

Brought to you byTop Sectors

A Player feature.See how many ways this pain can be solved, who's already building, and where the gaps are.

Related panes

/ same corner of the problem