-
Notifications
You must be signed in to change notification settings - Fork 29.6k
[Cache Components] Reenable static shell validation on client nav in Dev #85055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gnoff
wants to merge
1
commit into
vercel:canary
Choose a base branch
from
gnoff:reenable-dio-validation-on-client-nav
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+44
−11
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code passes
false
unconditionally as theisNotFound
parameter tospawnDynamicValidationInDev
, but it should check if the response status code is 404 like the existing code does at line 2578.View Details
Analysis
Incorrect hardcoded
false
for isNotFound parameter in generateDynamicFlightRenderResultWithStagesInDevWhat fails:
generateDynamicFlightRenderResultWithStagesInDev
at line 842 passesfalse
unconditionally tospawnDynamicValidationInDev
, but should checkctx.res.statusCode === 404
like the call at line 2578 does. This causes incorrect metadata and validation error handling for 404 pages during development HMR validation.How to reproduce:
app/not-found.js
orpages/404.js
)NODE_ENV=development
and cache components enabledisNotFound=false
instead ofisNotFound=true
Expected vs actual behavior:
isNotFound
parameter should reflect whether the response is a 404 (i.e.,res.statusCode === 404
)getRSCPayload
(line 1278), which affects how validation errors are reported for 404 pagesfalse
, causing validation to treat 404 pages as normal pagesctx.res.statusCode === 404
, matching the pattern used at line 2578 inrenderToStream
Pattern consistency: The response object
ctx.res
is initialized withstatusCode = 404
at line 1651-1652 for 404 page paths and is included inAppRenderContext
. Both call sites tospawnDynamicValidationInDev
should use the same logic.Fix: Change line 842 from
false,
toctx.res.statusCode === 404,