Repository navigation
fix(router-core): load the ancestor errorComponent chunk that renders a child error - #8793
sarankumar1325 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: f6c99d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
🎯 Changes
Fixes #8792.
When a child loader throws and the child has no
errorComponent(and there is nodefaultErrorComponent), the error renders through the nearest ancestor'serrorComponent.reduceLaneonly loaded the failing match's ownerrorComponentchunk, so with a code-split ancestor boundaryrouter.load()resolved before that chunk was ready and the first render was empty.After loading the failing match's chunk, the lane now walks up to the first route whose
errorComponent ?? defaultErrorComponentis set and loads that route'serrorComponentchunk before committing. If the failing route (or the default) already provides one, nothing extra is loaded.Tests in
boundary-component-chunk.test.ts:load()stays pending until the ancestor'serrorComponentpreload resolves (fails on main), and the ancestor chunk is not requested when adefaultErrorComponentcatches the error at the child.Disclosure: written with AI assistance; I reviewed the change and ran the tests below.
✅ Checklist
Tested:
router-coretest:unit(3653 passed),test:eslint,test:types;react-router,solid-routerandvue-routertest:unitpass.🚀 Release Impact
Summary by CodeRabbit