-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Which project does this relate to?
Router
Describe the bug
When defining non-nested routes that include dynamic route segments, the route parameter (e.g. "$postId") appears as undefined in Tanstack Router Devtools where the dynamic string should be resolved.
This causes incorrect router data to be returned, as a cache hit occurs after the route has been visited once, using the wrong ID because the dynamic segment is undefined.
This is my folder structure:
routes/
├── $postId.tsx
└── $postId_/
└── edit.tsx
I have also provided a reproducable example.
Your Example Website or App
https://stackblitz.com/edit/github-rpqhbuv7
Steps to Reproduce the Bug or Issue
- Click on "Post 1"
- Click on "Edit post"
- Click on "Home"
- Click on "Post 2"
- Click on "Edit post"
- Data from Post 1 is shown
Expected behavior
I expect the route loader to return the data for Post 2.
Screenshots or Videos
Platform
- Router / Start Version: 1.134.12
- OS: Windows
- Browser: Chrome
- Browser Version: 141.0
- Bundler: Vite
- Bundler Version: 7.1.7
Additional context
No response
HeyRistaa and Englund0110
Metadata
Metadata
Assignees
Labels
No labels
