nextjs
build_error
ai_generated
true
Error: Page is missing generateStaticParams()
ID: nextjs/generatestaticparams-error
92%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 14 | active | — | — | — |
Root Cause
Dynamic route with output: 'export' requires generateStaticParams to know all possible paths.
genericWorkarounds
-
95% success Add generateStaticParams to return all possible params
export async function generateStaticParams() { const posts = await getPosts(); return posts.map(p => ({ slug: p.slug })); }Sources: https://nextjs.org/docs/app/api-reference/functions/generate-static-params
-
88% success Use dynamicParams = false to return 404 for unknown params, or true (default) for ISR
Use dynamicParams = false to return 404 for unknown params, or true (default) for ISR
Sources: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams
Dead Ends
Common approaches that don't work:
-
Remove the dynamic route segment
80% fail
You need the dynamic route — removing it changes the URL structure
-
Set output: 'standalone' to avoid static generation
60% fail
Changes deployment model entirely
Error Chain
Frequently confused with: