Closed reihwald closed 3 months ago
is this the same as https://github.com/TanStack/router/issues/1550?
@schiller-manuel It certainly looks very similar. This issue is however still happening on the latest version even after that merged PR.
could be a regression caused by moving over to unplugin
cc @SeanCassiere
could be a regression caused by moving over to unplugin
cc @SeanCassiere
Very unlikely tbh. Their implementation for vite is dead-simple.
Found a tiny crutch to work around it - used vite-plugin-restart
to restart vite every time route files change. I think it should be definitely a bad one for large projects (mine was just started two days ago). Hope the issue is fixed soon!
Describe the bug
I noticed that my routes are no longer getting generated after updating my vite plugin. This is most noticeable by the fact that creating a new file in the routes folder no longer generates the small createFileRoute snippet.
It is possible to trigger the plugin to update the gen.ts file by stopping the relaunching the vite dev command but I am still not getting the correct type inference in my editor when using search params. Everything works fine when doing a production build.
This is caused by the root setting in vite. Removing it and configuring vite to run without it makes the problem disappear.
Your Example Website or App
https://stackblitz.com/edit/github-snnf6b
Steps to Reproduce the Bug or Issue
npm run dev
someFolder/anotherFolder/routes
with a name like test.tsxcreateFileRoute
snippet is being generatedPlease note that the vite example does not show anything when running the dev command. We run vite in a customized environment but this should not be of concern for this bug.
Expected behavior
Please take a look at this example: https://stackblitz.com/edit/github-snnf6b-aobdnw
1.34.8
of@tanstack/router-vite-plugin
.createFileRoute
snippetI'd expect that the vite plugin still work when using the root setting.
Screenshots or Videos
No response
Platform
Additional context
No response