-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Which project does this relate to?
Router
Describe the bug
Taking the example route from the documentation of posts/{-$category}, this is documented to match both /posts and /posts/category.
While this normally works as expected, if a "route" component exists, such as this:
posts/
{-$category}.tsx
route.tsx
/posts now fails to match anything. The route.tsx is rendered but the outlet is just left empty. If route.tsx is removed, the category route is rendered as expected.
This looks related to things like #5799 and #5635, but the fix attached to both those issues seems to have already landed and did not resolve this issue.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Visit the StackBlitz link (modified from the "Basic (file-based)" example)
- Navigate to "Posts"
- Observe that "no category" fails to match, but categories A and B are fine.
- Rename/delete
posts.route.tsxand observe the "no category" route rendering fine.
Expected behavior
The URL /posts matches posts/{-$category}.tsx as expected/documented.
Screenshots or Videos
Example from the router devtools in my app:

Despite the route being /workspaces/some-workspace-id, the {-$folderId} route does not match.
Platform
- Router / Start Version:
1.136.17 - OS: Windows
- Browser: Both Chrome/Edge
- Browser Version:
>= 142.0 - Bundler:
vite - Bundler Version:
7.1.7
Additional context
No response