fix(next/client): add prerender opt-out to PrefetchCrossZoneLinks#52
Open
fix(next/client): add prerender opt-out to PrefetchCrossZoneLinks#52
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds a `prerender?: boolean` prop (default `true`) to `<PrefetchCrossZoneLinks />`. When `false`, the component emits only the `prefetch:` rules and omits the `prerender:` block from the `<script type="speculationrules">` JSON. Cross-zone prefetch is unchanged. Escape hatch for consumers seeing Chromium prerender-activation crashes on cross-deployment same-origin navigations (Chrome 147+). Default behavior unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
8da2cc3 to
ccb3465
Compare
mknichel
approved these changes
May 4, 2026
Author
|
Holding on merging until we see if Chrome 148 lands soon: This PR may not be needed at all. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Chrome 147 crashes the browser process (
EXC_BREAKPOINT (SIGTRAP)inCrBrowserMain) when activating a prerendered cross-deployment same-origin navigation triggered by the speculation-rulesprerender:block this component emits. The crash reproduces onvercel.comcross-zone navigation and disappears when Prerender2 is disabled inchrome://flagsor when theprerender:block is dropped from the emitted JSON.prefetch:is unimplicated.This is a temporary platform-side escape hatch until the underlying Chromium issue is fixed. We're shipping it as a
pnpm patchinvercel/fronttoday (vercel/front#69103) by deleting theprerender:block from the installeddist/, and want a sanctioned way for any other consumer to do the same without patching.What
Adds a
prerender?: booleanprop to<PrefetchCrossZoneLinks />, defaulttrue— so default behavior is unchanged.When
false, the emitted<script type="speculationrules">JSON contains only theprefetch:rules and omits theprerender:block entirely. Cross-zone prefetch (hover + visibility) is unaffected.Source-equivalent diff (full diff for context):
Purely additive; no behavior change for callers that don't pass the prop.
Versioning
Minor (
@vercel/microfrontends) — new public prop, default keeps prior behavior.Follow-ups
where:predicate for theprerender:rule to require[data-prefetch]. That change was dropped because it didn't actually prevent the crash in practice — anyprerender:rule emitted at all reproduces it on Chrome 147. The opt-out is the only fix that works.