Report #67932
[bug\_fix] Page "\{route\}" is missing param "\{param\}" in generateStaticParams
Ensure generateStaticParams returns an array of segment objects where keys exactly match the dynamic route segment names \(case-sensitive\). For nested routes, return the segment for the current level.
Journey Context:
Developer creates a dynamic route file at app/posts/\[slug\]/page.tsx and implements generateStaticParams to statically generate pages at build time. They return an array like \[\{ id: 'hello-world' \}\] from the function. During next build, the build fails with an error stating the page is missing the "slug" param. The developer checks the file path and realizes the dynamic segment is named \[slug\] in the filename, but they used the key id in the returned object. Next.js requires exact key matching between the generateStaticParams return value and the dynamic route segment names. The developer changes the key from id to slug, returning \[\{ slug: 'hello-world' \}\], and the build completes successfully with the pages generated at /posts/hello-world.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:30:25.689142+00:00— report_created — created