Why is tanstack router not updating routes? #1180
-
First Check
Commit to Help
Example Code
DescriptionI'm trying to add new routes to the project, but I found that tanstack routes aren't being updated. routeTree.gen.ts needs should be automatically updated for any modification to the routes to work, but it isn't. How can we verify the problem is that routeTree.gen.ts is not being updated? I realize i could npm install @tanstack/router-cli --save-dev and call npx tsr generate to re-generate the file, but in my opinion what would be correct is for the build process to generate the correct file, and in fact I believe it should with the current setup. This issue could help in achieving that, but just adding that to package.json doesn't work, ofc, We probably need to modify other parts of the package.json or of the dockerfiles, but as of right now i'm unsure which/how in order to achieve the best architechture. Operating SystemWindows Operating System DetailsI don't think more details are relevant. Python Version3.12.1 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone that comes across this post: The reason that tan stack router is not updating routes is that docker compose up --build doesnt run the frontend in development mode, if running the project without docker, following the steps located here , the routes will be properly updated. It makes sense that the plugin doesn't update routes when not in development mode, since otherwise the build you deploy could be different from the build you tested in development, so I don't suggest fixing the issue since its behavior is correct. That said, I assumed that the docker compose file was meant to be used for local development, unless explicitly overriden, and that doesn't seem to be the case, it seems the author intends development with this template to be done containerless, and so, the docker-compose is actually a local deployment composition. TLDR: For development run the individual parts. |
Beta Was this translation helpful? Give feedback.
For anyone that comes across this post:
The reason that tan stack router is not updating routes is that docker compose up --build doesnt run the frontend in development mode, if running the project without docker, following the steps located here , the routes will be properly updated.
It makes sense that the plugin doesn't update routes when not in development mode, since otherwise the build you deploy could be different from the build you tested in development, so I don't suggest fixing the issue since its behavior is correct.
That said, I assumed that the docker compose file was meant to be used for local development, unless explicitly overriden, and that doesn't seem to be the case, it…