Next.js · sdk · fg-0302

generateStaticParams returning an empty array fails the build once cacheComponents is on

Build error linking to /docs/messages/empty-generate-static-params

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

Under cacheComponents, Next.js needs at least one param to prerender and validate the route's static shell. The old pattern of returning [] to defer everything is now an error.

Fix

Return at least one real param. Unlisted params are still rendered at request time. Keep the export, because deleting it opts the route out of ISR.

Apply

export async function generateStaticParams() {
  const posts = await getPosts()
  return posts.slice(0, 1).map((p) => ({ slug: p.slug }))
}

Affects: Next.js 16.x with cacheComponents: true

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp