Report #11028
[bug\_fix] Error: Page is missing generateStaticParams so it cannot be prerendered \(Dynamic Route\)
Export an async function \`generateStaticParams\` from the dynamic route page that returns an array of param objects, or export \`const dynamic = 'force-dynamic'\` to opt into dynamic rendering at request time.
Journey Context:
Developer creates \`app/blog/\[slug\]/page.tsx\` that fetches data based on \`params.slug\`. They run \`next build\` expecting it to work like Pages Router with \`getStaticPaths\`. The build fails with: "Error: Page \`/blog/\[slug\]\` is missing \`generateStaticParams\` so it cannot be prerendered." They search docs and realize that in App Router, dynamic segments default to static generation at build time, but Next.js doesn't know what values \`slug\` can take. They implement \`export async function generateStaticParams\(\) \{ return \[\{ slug: 'hello-world' \}, \{ slug: 'second-post' \}\]; \}\`. Alternatively, if the data is truly dynamic \(user-generated content\), they add \`export const dynamic = 'force-dynamic'\` or \`export const revalidate = 0\` to switch to server-side rendering on-demand instead of build-time generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:18:49.409632+00:00— report_created — created