Next.js: Page "/blog/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" config
A dynamic route can't be statically exported without telling Next.js which paths to generate.
Page "/blog/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" configis missing generateStaticParams() so it cannot be used with output: exportPage is missing exportPathMap for dynamic routeError: Page with `dynamic = "force-dynamic"` couldn't be exported. `output: "export"` requires all pages be renderable statically Meaning
With output: 'export' every dynamic segment needs generateStaticParams() returning all params at build time (and dynamicParams = false if you want 404s for others). Or drop output: 'export' and use server rendering.
Common causes
output: "export"with dynamic routes- generateStaticParams missing or returns empty
- Data fetch for params failing at build
- Using server-only features with export
- Wrong segment names
⚡ Quick fix
export async function generateStaticParams() { return posts.map(p => ({ slug: p.slug })) }- Add
export const dynamicParams = false - Remove
output: "export"if you need runtime routes
Detailed fix by platform
Next.js
export const dynamicParams = false; export async function generateStaticParams() { return [{ slug: "a" }, { slug: "b" }]; }
How to diagnose
- Export — output: export?
- Params — Listed?
- Alternative — Server hosting?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- [Vue warn]: Component is missing template or render function Vue: [Vue warn]: Component is missing template or render function.
- Component provided template option but runtime compilation is not supported Vue: [Vue warn]: Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js"
- Could not find a production build in the '.next' directory Next.js: Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server
Most viewed in Next.js
- NEXT_REDIRECT Next.js: Error: NEXT_REDIRECT (redirect() inside try/catch)
- server-only Next.js: You're importing a component that needs "server-only". That only works in a Server Component
- cookies() should be awaited Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026