router icon indicating copy to clipboard operation
router copied to clipboard

Hot reloading issue for nested directory routes

Open thejasonxie opened this issue 2 years ago • 3 comments

Which project does this relate to?

Router

Describe the bug

Nested child routes have issues hot reloading. First experienced on v1.63.5 then updated to latest(v1.85.4) and issue is still there.

I recreated the issue on stackblitz but isn't the issue isn't exactly like my local. On stackblitz, the hot reloading stops working on a nested dynamic directory route path, while in my local project it happens before the dynamic route path.

eg. on stackblitz hot reloading stops working at /_test/(evaluate)/evaluate/_index/projects/$id/, in my local project its /_test/(evaluate)/evaluate/_index/projects

When i hit save, i see tanstack router regenerating routes in cli and i see vite hot reload firing in browser logs but the ui does not update.

Okay just recreated hot reload issue on non-dynamic route. updated stackblitz. Basically using router hooks (useParams,useLocation, etc.) breaks hot reload in nested routes

Thank you

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-pwcdcu?file=src%2Froutes%2F_test%2F(evaluate)%2Fevaluate._index.projects%2F%24id%2Findex.tsx,src%2Froutes%2F_test%2F(evaluate)%2Fevaluate._index.projects%2Findex.tsx,src%2Froutes%2F_test%2F(evaluate)%2Fevaluate._index.projects%2F%24id.tsx,src%2Froutes%2F_test%2F(evaluate)%2Fevaluate._index.projects.tsx

Steps to Reproduce the Bug or Issue

  1. go to /evaluate/projects/234
  2. try modifying src/routes/_test/(evaluate)/evaluate._index.projects/$id/index.tsx

Expected behavior

Hot reloading to work on all types of nested routes

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

thejasonxie avatar Dec 03 '24 15:12 thejasonxie

+1 - I noticed this in app/components directory too (example: https://stackblitz.com/github/tanstack/router/tree/main/examples/react/start-convex-trellaux?embed=1&theme=dark&preset=node&file=app/components/Board.tsx)

lawandothman avatar Dec 04 '24 21:12 lawandothman

Is this still an issue?

brenelz avatar Aug 02 '25 19:08 brenelz

closing as no response was given. if anyone encounters a similar issue, please create a new github issue including a complete minimal example

schiller-manuel avatar Sep 28 '25 22:09 schiller-manuel