Next.js · sdk · fg-0302

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

If you see Build error linking to /docs/messages/empty-generate-static-params, the cause and the fix for Next.js are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Build error linking to /docs/messages/empty-generate-static-paramsA dynamic route that deferred all paths to runtime with return [] stops buildingRemoving generateStaticParams makes the build pass but the route renders on every request
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 })) }
Affected
Next.js 16.x with cacheComponents: true
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun