-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
Fix empty white page with parallel routes + loading boundaries #61597
Merged
ztanner
merged 1 commit into
canary
from
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
Feb 13, 2024
Merged
Fix empty white page with parallel routes + loading boundaries #61597
ztanner
merged 1 commit into
canary
from
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
Feb 13, 2024
Conversation
This file contains 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
ijjk
added
area: tests
created-by: Next.js team
PRs by the Next.js team
type: next
labels
Feb 2, 2024
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Stats from current PRDefault BuildGeneral
Client Bundles (main, webpack)
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size
Middleware size
Next Runtimes
Diff detailsDiff for page.jsDiff too large to display Diff for 68-HASH.jsDiff too large to display |
Tests Passed |
ztanner
force-pushed
the
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
branch
from
February 2, 2024 23:19
1a16b7c
to
5afe77f
Compare
Hi @ztanner. Any updates on this? This is causing bad UX on our website. |
ztanner
force-pushed
the
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
branch
from
February 12, 2024 23:34
5afe77f
to
081d8d7
Compare
ztanner
force-pushed
the
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
branch
from
February 12, 2024 23:34
081d8d7
to
86402fb
Compare
ztanner
force-pushed
the
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
branch
from
February 12, 2024 23:39
86402fb
to
1605e51
Compare
ztanner
requested review from
timneutkens,
ijjk,
shuding,
huozhi,
feedthejim and
wyattjoh
as code owners
February 13, 2024 00:13
acdlite
approved these changes
Feb 13, 2024
ztanner
deleted the
02-02-Fix_empty_white_page_with_parallel_routes_loading_boundaries
branch
February 13, 2024 00:30
This was referenced Feb 14, 2024
1 task
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
When navigating to a page that uses a loading boundary + parallel route, an empty white screen would be displayed rather than the loading state / final state
Why
With parallel routes, the RSC data is an array of data paths, each corresponding with one of the parallel segments rendered on the page.
During the navigation event, when we iterate over this data, we call
applyFlightData
with this data path & an empty cache node.applyFlightData
checks to see if the flight data contains cache nodes ("seed data"). If it doesn't, then that means it has no work to do, and it bails out. Pre-PPR and in the case of having aloading.js
file,walkTreeWithFlightRouterState
doesn't return any seed data, just router state. This means thatapplyFlightData
will not have any work to do on the new cache node, and leaves it untouched.Once
applyFlightData
is finished, but while still in the flight data path loop, we reassigncurrentCache
to the empty cache object we created prior toapplyFlightData
. But since that cache node has remained empty, the next iteration of the loop is going to be inspecting a now empty cache, rather than the actual "current" cache. Now there's no existing cache to copy into the new cache. The app now doesn't know about any cache nodes.How
It doesn't seem like we should be re-assigning
currentCache
to the new cache. In the context of a navigation, it seems more accurate to always assumecurrentCache
is the cache now, since it won't actually be applied to the state until the action has finished (mutable.cache
is currently taking care of this).Closes NEXT-2223
Fixes #61080
Fixes #60682
Fixes #56701