You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
notFound() won't emit head data if __root has an async loader #6085
#5495 - fix(react-router,solid-router): top-level Matches should use pendingComponent on root route [merged] #5500 - docs(beforeLoad & notFoundComponents): Add note regarding notFound error thrown from beforeLoad function [merged] #5518 - Solid hydration [merged] #5686 - fix(router-core): Catch errors thrown during hydrate [merged] #5890 - Fix: Route with server function as loader that throws notFound crashes route on HMR #5763 [merged]
so i thought i could work around this by putting the root loader logic into beforeLoad, but now if that fails i hit #4684. so there isn't actually a way to perfectly work around this bug.
in the work app this means that if one of the backend services are down, a fetch or db failure. and these do happen (but rarely) according to observability.
oh shoot my bad. but changing it still causes the bug to reproduce, but only on the initial page load. this was what we were facing at work.
if you replace it it works as expected:
did you try doing a page refresh on it? that is the bug.
the workaround for us is to add code on every notFound to call ensureQueryData for the query that we have in our root's loader, so that the root loader completes before notFound is thrown
Activity
coderabbitai commentedon Dec 12, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Possible Duplicates
Related Issues
headis not executed whenbeforeLoadthrows an Error #4684🔗 Related PRs
#5495 - fix(react-router,solid-router): top-level
Matchesshould usependingComponenton root route [merged]#5500 - docs(beforeLoad & notFoundComponents): Add note regarding notFound error thrown from beforeLoad function [merged]
#5518 - Solid hydration [merged]
#5686 - fix(router-core): Catch errors thrown during hydrate [merged]
#5890 - Fix: Route with server function as loader that throws notFound crashes route on HMR #5763 [merged]
👤 Suggested Assignees
🧪 Issue enrichment is currently in early access.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:paperclover commentedon Dec 12, 2025
so i thought i could work around this by putting the root loader logic into beforeLoad, but now if that fails i hit #4684. so there isn't actually a way to perfectly work around this bug.
in the work app this means that if one of the backend services are down, a fetch or db failure. and these do happen (but rarely) according to observability.
schiller-manuel commentedon Dec 13, 2025
your reproduction uses this in the route, which does not work on the client
if you replace it it works as expected:
paperclover commentedon Dec 13, 2025
oh shoot my bad. but changing it still causes the bug to reproduce, but only on the initial page load. this was what we were facing at work.
did you try doing a page refresh on it? that is the bug.
the workaround for us is to add code on every notFound to call
ensureQueryDatafor the query that we have in our root's loader, so that the root loader completes before notFound is thrownschiller-manuel commentedon Dec 13, 2025
can reproduce this on initial page load, looking into it
Eiley2 commentedon Dec 14, 2025
I think this issue might be related. Mind taking a look? #5960