Which project does this relate to?
Router
Describe the bug
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"
Your Example Website or App
https://stackblitz.com/edit/github-qz55lodc?file=src%2Froutes%2Ftest.tsx
Steps to Reproduce the Bug or Issue
- With the following file-based setup, extended from one found in the docs:
routes/
├── $postId/
├── _postPathlessLayout/
│ ├── works.tsx
├── _postPathlessLayout.tsx
- 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.tsx notFoundComponent to be shown.
Screenshots or Videos
No response
Platform
- OS: [macOS]
- Browser: [Chrome]
- Version: [1.117.1]
Additional context
No response
Which project does this relate to?
Router
Describe the bug
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"Your Example Website or App
https://stackblitz.com/edit/github-qz55lodc?file=src%2Froutes%2Ftest.tsx
Steps to Reproduce the Bug or Issue
notFoundComponentset on both_root.tsx&_postPathlessLayout.tsx/my-post-id/worksand see the expected page./my-post-id/not-exists. It will show "TanStack Router's overly generic defaultNotFoundComponent", rather than picking the customnotFoundComponents which are set on the parent_root.tsxor_postPathlessLayout.tsxroutesExpected behavior
I would expect the
_postPathlessLayout.tsxnotFoundComponentto be shown.Screenshots or Videos
No response
Platform
Additional context
No response