Commit Graph

2 Commits

Author SHA1 Message Date
Jiwon Choi f2e6abb47e Throw for empty or incomplete generateStaticParams results with output: export (#95969)
> [!TIP]
> This PR is best reviewed commit by commit.

### Why?

With `output: 'export'`, an empty array or incomplete params can be
reported as a missing `generateStaticParams` function, even when the
function exists.

### How?

- Throw when any `generateStaticParams` invocation returns `[]`.
- Throw when any composed parent and child params object omits a dynamic
route parameter.
- Extend the troubleshooting page added in #95968 with the
export-specific cases.

Stacked on #95968.

Supersedes #95388.

<!-- NEXT_JS_LLM -->

Co-authored-by: SukkaW <isukkaw@gmail.com>
2026-07-23 23:25:55 +02:00
Jiwon Choi 81643544fc Throw when generateStaticParams returns invalid values (#95968)
> [!TIP]
> This PR is best reviewed commit by commit.

### Why?

`generateStaticParams` must return an array of objects, but Next.js does
not currently provide a clear error when it returns something else.

### How?

- Throw when `generateStaticParams` does not return an array.
- Throw when an item in the returned array is not an object.
- Keep allowing `{}`. The follow-up rejects it with `output: 'export'`
when it leaves a dynamic route parameter missing.

Follow-up: #95969

Supersedes #95388.

<!-- NEXT_JS_LLM -->

Co-authored-by: SukkaW <isukkaw@gmail.com>

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-07-23 23:25:55 +02:00