Files
next.js/errors
Aurora ScharffandGitHub f965c00411 Insights: drop irrelevant fix cards from instant errors (#94926)
### Why?

Two Insight fix cards were misleading:

1. **`generateStaticParams` showed up on every runtime/client-hook
insight.** One error covers `cookies()` / `headers()` / `params` /
`searchParams`. GSP only applies to `params`; for the others it's noise.
Even for `params` it nudges devs to make the route static instead of
fixing the immediate error.
2. **`"use cache"` showed up on `connection()` triggers.** Caching
`connection()` is contradictory.

Both manifest on initial load and in-navigation (the fix-card sets are
shared).

### What?

1. **Drop the GSP card** from runtime + client-hook sets. Affects
[01-cookies-body](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/01-cookies-body),
[03-params-body](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/03-params-body),
[90-client-use-params](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/90-client-use-params),
[41-subnav-cookies](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/41-subnav-cookies),
[42-subnav-fetch](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/42-subnav-fetch).
2. **Filter `"use cache"`** when the cause is `connection()`. Affects
[05-connection-body](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/05-connection-body),
[08-connection-body-dynamic](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/08-connection-body-dynamic),
[31-connection-in-metadata](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/31-connection-in-metadata),
[33-connection-in-viewport](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/33-connection-in-viewport).
[06-uncached-fetch-body](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/06-uncached-fetch-body)
keeps the Cache card.

### How?

- `getCards()` filters the cache card when `cause === 'connection'`.
- New `deriveCauseFromCodeFrame()` helper detects `connection(` on the
highlighted code-frame line.
- `ParamClientHookDynamicError` collapsed into `ClientHookDynamicError`.
- CLI/build messages: dropped the GSP bullet; added `(does not apply to
\`connection()\`)` on the cache bullet.
- Docs: removed `For known params, prerender` sections; added a
connection caveat on dynamic/metadata-dynamic/viewport-dynamic pages.

<!-- NEXT_JS_LLM_PR -->
2026-06-23 19:27:11 +02:00
..
2025-05-08 13:11:38 +01:00
2025-05-12 08:32:57 -05:00
2025-05-12 08:32:57 -05:00