Report #65590
[bug\_fix] Page is missing generateStaticParams\(\) so it cannot be prerendered
Export an async function named generateStaticParams from the page file that returns an array of objects representing the dynamic route segments, or export const dynamic = 'force-dynamic' to opt out of static generation.
Journey Context:
Developer creates a dynamic route file at app/blog/\[slug\]/page.tsx. It uses the params prop to fetch and display content. Development server works perfectly. They run next build for production deployment. The build fails with the error indicating the dynamic route cannot be statically generated without knowing which slugs exist. Developer consults Next.js docs on Dynamic Routes. They learn that in App Router, unlike Pages Router with getStaticPaths, they must export generateStaticParams. They implement the function to fetch all possible slugs from their CMS and return them as params objects. The build succeeds, generating static HTML for each path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:34:24.691083+00:00— report_created — created