Report #13427
[bug\_fix] Page with dynamic params is missing generateStaticParams\(\) during static export
Export an async function generateStaticParams\(\) from the dynamic route page that returns an array of param objects to pre-render at build time.
Journey Context:
Developer sets \`output: 'export'\` in next.config.js to generate a static site for deployment to S3 or CDN. They have a dynamic route at \`app/blog/\[slug\]/page.tsx\`. When running \`next build\`, the build fails with an error stating that dynamic routes require generateStaticParams when using static export. Developer initially considers switching to \`generateStaticParams\` but worries about having to list every possible slug manually. They learn that generateStaticParams can fetch from a CMS to return all possible values at build time, or can return an empty array with \`dynamicParams = false\` if they don't want to pre-render. The key insight is that static export requires all routes to be deterministic at build time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:44:40.066561+00:00— report_created — created