Repository navigation
fix(pages): skip static page-data requests for routes with prerender disabled - #707
Merged
Merged
Conversation
cpojer
self-requested a review
November 4, 2026 12:21
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.
With
output: "static", navigating to a regular page that exportsprerender = falsefirst requests a static page-data file that was never generated:The page eventually loads through the server fallback, but the failed static request adds a network round trip before the server request starts. Prefetching takes the same path.
Cause
resolveStaticPageDataBuildOptions()enables static page-data fetching for the app whenoutput === "static".The page scanner already records explicit prerender opt-outs, but
generateComponentManifest()only included island flags in the client’srouteMeta. The browser therefore had no way to distinguish a route with prerendering disabled from one eligible for static page data.matchStaticPageId()accepted any matched, non-island page with a component. Both navigation and prefetch used that check before requesting/_void/pages/<path>.json.Fix
Include
prerender: falsein the generated route metadata for pages that explicitly opt out, preserving any existingisland: trueflag on the same route.matchStaticPageId()now rejects those routes before a static JSON request starts. Because navigation and prefetch share this check, both request server page data directly:Metadata remains sparse: explicitly enabled and unset prerender settings do not add an entry. The check uses
prerender !== false, so automatic prerendering and the existing static JSON fast path continue to work.The shared navigation config and React client config types now accept the prerender metadata.