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
Not found component not working in dynamic route segment with nested layout route #4065
A pathlessLayoutRoute within a Dynamic route segment does not trigger the parent routes' notFoundComponent, even from the root. Instead it uses the "TanStack Router's overly generic defaultNotFoundComponent"
And a notFoundComponent set on both_root.tsx & _postPathlessLayout.tsx
Check that navigating to a real page works: /my-post-id/works and see the expected page.
Try to navigate to a page that does not exist, like /my-post-id/not-exists. It will show "TanStack Router's overly generic defaultNotFoundComponent", rather than picking the custom notFoundComponents which are set on the parent _root.tsx or _postPathlessLayout.tsx routes
Expected behavior
I would expect the _postPathlessLayout.tsxnotFoundComponent to be shown.
I'm running into this exact same issue using React 19 and the latest version of @tanstack/router. This is my first time working with this router, so I don’t have a reference point from previous versions to compare behavior.
Is this a recent regression or has it always worked this way?
Same here. I have a dynamic route, but its index isn't made (i didn't made) but others are like /abc/a is made, /abc/b is made but not /abc, navigating to /abc will show routers warning and its <div>Not Found</div> on the page, not my custom not found. I am using devinxi start.
Hey we could not reproduce the issue. I'm going to close this, but if it still happens on the latest versions, feel free to reopen. It may have been fixed by #6120
Activity
mariana-truta-zg commentedon Apr 29, 2025
I'm running into this exact same issue using React 19 and the latest version of @tanstack/router. This is my first time working with this router, so I don’t have a reference point from previous versions to compare behavior.
Is this a recent regression or has it always worked this way?
borstessi commentedon May 28, 2025
I have this issue as well. But not only for pathless routes.
MuntasirSZN commentedon Jun 14, 2025
Same here. I have a dynamic route, but its index isn't made (i didn't made) but others are like /abc/a is made, /abc/b is made but not /abc, navigating to /abc will show routers warning and its
<div>Not Found</div>on the page, not my custom not found. I am using devinxi start.leonardbiofi commentedon Aug 26, 2025
Same.
Also the issue and the things that is confusing is that /$postId route should not be routable. But it still returns an empty page and not a 404 error
rahulxdemon commentedon Jan 14, 2026
I am also facing the same issue. It is still not resolved
Sheraff commentedon Jul 14, 2026
Hey we could not reproduce the issue. I'm going to close this, but if it still happens on the latest versions, feel free to reopen. It may have been fixed by #6120