Skip to content

Insights: drop irrelevant fix cards from instant errors#94926

Merged
aurorascharff merged 20 commits into
canaryfrom
codex/remove-gsp-fix-card-from-runtime-and-connection
Jun 23, 2026
Merged

Insights: drop irrelevant fix cards from instant errors#94926
aurorascharff merged 20 commits into
canaryfrom
codex/remove-gsp-fix-card-from-runtime-and-connection

Conversation

@aurorascharff

@aurorascharff aurorascharff commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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, 03-params-body, 90-client-use-params, 41-subnav-cookies, 42-subnav-fetch.
  2. Filter "use cache" when the cause is connection(). Affects 05-connection-body, 08-connection-body-dynamic, 31-connection-in-metadata, 33-connection-in-viewport. 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.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Stats cancelled

Commit: af1ebc4
View workflow run

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: af1ebc4

@aurorascharff aurorascharff marked this pull request as ready for review June 18, 2026 00:06
Copilot AI review requested due to automatic review settings June 18, 2026 00:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines the “Ways to fix this” guidance for instant-prerender validation errors across the dev overlay, CLI/build error messages, docs, and e2e tests by removing misleading fix cards and adding a connection()-specific cache caveat.

Changes:

  • Remove the generateStaticParams / “For known params, prerender” guidance from relevant instant-prerender error families (runtime + client-hook).
  • Suppress the "use cache" fix card when the dynamic error is triggered by connection(), including deriving the connection cause from the highlighted code-frame line in the overlay.
  • Update error strings (including errors.json) and test snapshots to reflect the new guidance.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/e2e/app-dir/instant-validation/instant-validation.test.ts Updates expected fix-bullets to drop GSP and qualify cache for connection().
test/e2e/app-dir/instant-validation/instant-validation-parallel-slots.test.ts Removes expected GSP fix-bullets from runtime variants.
test/e2e/app-dir/instant-validation-level-warning/instant-validation-level-warning.test.ts Updates expected cache bullet with connection() caveat.
test/e2e/app-dir/instant-validation-level-manual-warning/instant-validation-level-manual-warning.test.ts Updates expected cache bullets and removes GSP bullet expectations.
test/e2e/app-dir/instant-validation-level-manual-error/instant-validation-level-manual-error.test.ts Updates expected cache bullet with connection() caveat.
test/e2e/app-dir/instant-validation-level-error/instant-validation-level-error.test.ts Updates expected cache bullet with connection() caveat.
test/e2e/app-dir/instant-validation-build/instant-validation-build.test.ts Updates expected cache bullet with connection() caveat.
test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts Updates expected metadata/viewport cache bullets and removes GSP bullet expectations.
test/e2e/app-dir/cache-components-errors/cache-components-errors.client.test.ts Removes expected GSP fix-bullets from client-component variants.
test/e2e/app-dir/cache-components-errors/cache-components-client-hook-abort-reasons.test.ts Removes client-hook GSP expectations; needs snapshot updates for removed ParamClientHookDynamicError.
packages/next/src/server/dynamic-rendering-utils.ts Removes ParamClientHookDynamicError and narrows related type usage.
packages/next/src/server/app-render/dynamic-rendering.ts Switches client hook dynamic error construction to ClientHookDynamicError.
packages/next/src/server/app-render/blocking-route-messages.ts Removes GSP bullet and adds (does not apply to \connection()`)` to cache guidance.
packages/next/src/next-devtools/dev-overlay/container/errors.tsx Adds deriveCauseFromCodeFrame() to detect connection() on the highlighted code-frame line.
packages/next/src/next-devtools/dev-overlay/container/errors.test.ts Updates guidance tests for removed GSP and adds coverage for connection() cause derivation.
packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.ts Removes GSP cards and filters cache cards when cause === 'connection'.
packages/next/errors.json Adds/updates error-message entries reflecting the new guidance text.
errors/blocking-prerender-viewport-dynamic.mdx Documents that cache guidance does not apply to connection().
errors/blocking-prerender-runtime.mdx Removes “For known params, prerender” section and references.
errors/blocking-prerender-metadata-dynamic.mdx Documents that cache guidance does not apply to connection().
errors/blocking-prerender-dynamic.mdx Documents that cache guidance does not apply to connection().
errors/blocking-prerender-client-hook.mdx Removes “For known params, prerender” section and updates framing for client hooks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aurorascharff aurorascharff changed the title errors: drop irrelevant fix cards for instant-prerender errors Insights: drop irrelevant fix cards for instant-prerender errors Jun 18, 2026
@aurorascharff aurorascharff changed the title Insights: drop irrelevant fix cards for instant-prerender errors Insights: drop irrelevant fix cards from instant errors Jun 18, 2026

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestions:

  1. E2E snapshots in cache-components-errors.test.ts were not updated for the new (does not apply to connection()) caveat added to metadata [cache] bullets, so the dev redbox code and build prerender output assertions will fail CI.
  1. Dev collapsed-redbox snapshots for dynamic generateViewport() assert error code E1352, but the source message now matches errors.json code E1369 (the new message with the connection() caveat), so the assertions will fail CI.

Fix on Vercel

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Six build-mode (--debug-prerender) inline code-frame snapshots for useDynamicRouteParams assert line numbers that are +1 too high relative to the actual source in dynamic-rendering.ts, causing test-start-* CI failures.

Fix on Vercel

@aurorascharff aurorascharff requested a review from gnoff June 19, 2026 17:08
Button label is 'Copy as prompt'; the jsdoc was inaccurate.
…gsp-fix-card-from-runtime-and-connection

# Conflicts:
#	test/e2e/app-dir/cache-components-errors/cache-components-client-hook-abort-reasons.test.ts

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Build-mode (--debug-prerender) inline code-frame snapshots in cache-components-client-hook-abort-reasons.test.ts are stale: line numbers are +1 too high vs. source and 6 frames reference the removed class ParamClientHookDynamicError, so the build-mode CI jobs fail the toMatchInlineSnapshot assertions.

Fix on Vercel

Both line numbers and class name were stale:
- Line numbers were +1 too high vs current source.
- 6 frames referenced the removed ParamClientHookDynamicError class.

Per Roselbot's review on #94926.
The PR's own snapshots in cache-components-client-hook-abort-reasons.test.ts
still had:
  - the '[cache] For `params`: if the params are known, prerender them with
    `generateStaticParams`' bullet that this PR removes
  - the old '[cache] For uncached data' bullet without the new
    '(does not apply to `connection()`)' qualifier

28 occurrences fixed across both turbopack/webpack and debug-prerender/normal
variants.
Whitespace-only changes from cargo fmt --all.

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

createDynamicOrRuntimeViewportError's [cache] bullet is missing the (does not apply to connection()) caveat that the PR added to every other [cache] fix bullet, leaving an inconsistent, potentially misleading user-facing message.

Fix on Vercel

The viewport error's [cache] bullet was missing the
'(does not apply to `connection()`)' qualifier that this PR added to the
other [cache] bullets. Adds it for consistency and updates the 4 matching
snapshot occurrences in cache-components-errors.test.ts.

Per vercel[bot] review.
`createDynamicOrRuntimeViewportError`'s message changed in the previous
commit. Adds the new entry to errors.json so check-error-codes passes.
8 more useParams() build-mode inline snapshots referenced the removed
'[cache] For known params, prerender them with `generateStaticParams`'
bullet from blocking-prerender-client-hook. These were the client-hook
analog of the runtime/dynamic GSP bullet I removed earlier.

Per vercel[bot] review.
@aurorascharff aurorascharff requested a review from acdlite June 23, 2026 15:08
@aurorascharff aurorascharff merged commit f965c00 into canary Jun 23, 2026
128 of 129 checks passed
@aurorascharff aurorascharff deleted the codex/remove-gsp-fix-card-from-runtime-and-connection branch June 23, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants