TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.52k stars 528 forks source link

Dynamic invoice route in kitchen sink examples break (`could not find match...`) #1852

Closed andrejilderda closed 1 week ago

andrejilderda commented 1 month ago

Describe the bug

When you open one of the kitchen sink examples, the route breaks when you navigate to the invoices. Given the fact that I experience issues with dynamic routes in another codebase (that I haven't been able to succesfully reproduce in a small reproduction) this may indicate there's an underlying bug.

Your Example Website or App

https://stackblitz.com/github/tanstack/router/tree/main/examples/react/kitchen-sink-file-based?embed=1&theme=light&preset=node&file=src/main.tsx

Steps to Reproduce the Bug or Issue

  1. Open the official kitchen-sink example.
  2. Click on Dashboard › Invoices › select an invoice.
  3. Note that the invoice is loaded and the url is updated properly.
  4. Click on 'Home'.
  5. Click on Dashboard › Invoices › select an invoice.
  6. Note that the invoice is NOT loaded and the URL is NOT updated properly (flips back to /invoices).
  7. The error displayed in the console says: "Could not find match for from: /dashboard/invoices/$invoiceId"

Expected behavior

As a user I expect the route to be properly loaded the second time also.

Screenshots or Videos

https://github.com/TanStack/router/assets/487182/60e99303-744c-4811-9a12-9396a265cc65

Platform

Additional context

No response

schiller-manuel commented 3 weeks ago

@chorobin can you please have a look the error "Error: Invariant failed: Could not find match for from: /dashboard/invoices/$invoiceId" points to the recent changes where we check from at runtime