Next.js · build error

missing generateStaticParams() with output: export

what it looks like
Error: Page "/blog/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" config.

What it means

A static export has no server, so every dynamic route has to list its pages at build time.

Common causes

  • A new [slug] or [id] route in a site deployed as static files
  • generateStaticParams exists but sits in a "use client" page

How to fix it

  1. Export generateStaticParams() from the page and return every slug
  2. If the route really needs a server (per-user data), drop output: export and deploy to a host that runs Next.js
src/app/blog/[slug]/page.tsx
export async function generateStaticParams() {
  const posts = await getPosts();
  return posts.map((p) => ({ slug: p.slug }));
}

works with Next.js 16.4.3 · React 19.3last verified

Prompt for Cursor or Claude Code

next build fails because a dynamic route has no generateStaticParams and the app uses output: export. Add generateStaticParams that returns every value for this route from the same data source the page reads.

Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Next.js error fixer.

next: skip the next one

Skip the setup. The VibeBoot SaaS Starter gives you auth, Stripe and a database already wired on Next.js 16.4.3, with AGENTS.md and .cursor/rules that keep your agent on the Next.js 16 conventions. $49, one-time.

14-day money-back guarantee · lifetime updates

$ fixed it? get the next one first

New fixes for what AI agents break, by email.

When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.

Subscribe free