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
Root route component is rendered for non-matching-route path but not for missing resource #2255
The component defined in the rootRoute is rendered when a non-matching path riggers the rendering of the notFoundComponent but it is not rendered when a child route trows a notFound() value in its loader.
Note that this configuration does not have a defaultNotFoundComponent.
By default the Router has the setting of notFoundMode: 'fuzzy', where the router traverses up the tree until it finds the nearest notFoundComponent (which in this case would be the one configured on the root route).
@pupuking723, would you mind taking a look and letting us know what you find?
A fix would be welcome if it still reproduces. Please keep it focused on making the root layout consistent between an unmatched path and a loader-thrown notFound(), with regression coverage for both paths if it is still present :)
Activity
SeanCassiere commentedon Sep 3, 2024
Please attach a valid minimal reproduction showing off the issue in question.
Edit: Link to a stackblitz starter - https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based
lo1tuma commentedon Sep 4, 2024
I’ve used the
quickstart-code-basedas a template. Here is the adjusted version that demonstrates the issue https://stackblitz.com/edit/github-bfat87?file=src%2Fmain.tsxSteps to reproduce:
SeanCassiere commentedon Sep 4, 2024
Throwing a
notFounderror in a route's loader, outputs the following route-tree.Navigating to a route that DOES NOT EXISTS in the route-tree, results in this route-tree.
Note that this configuration does not have a
defaultNotFoundComponent.By default the Router has the setting of
notFoundMode: 'fuzzy', where the router traverses up the tree until it finds the nearestnotFoundComponent(which in this case would be the one configured on the root route).lo1tuma commentedon Sep 4, 2024
Thanks for the further investigation and writing a test-case @SeanCassiere. I haven’t thought about the
non-asynccase.My expected behavior would be that the behavior is consistent across all scenarios, so either the
NotFoundComponentshould be always wrapped or never.LadyBluenotes commentedon Jul 11, 2026
@pupuking723, would you mind taking a look and letting us know what you find?
A fix would be welcome if it still reproduces. Please keep it focused on making the root layout consistent between an unmatched path and a loader-thrown notFound(), with regression coverage for both paths if it is still present :)
LadyBluenotes commentedon Jul 11, 2026
Thanks for checking @pupuking723!