You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my vite config, I have root set to "./src". Initially this resulted in an error from the TanStackRouterVite plugin due to it trying to read the routes from ./src/src/routes, but I resolved this by adding routesDirectory: "./src/routes" and generatedRouteTree: "./src/routeTree.gen.ts" to the plugin config.
With this resulting setup, everything seems to work, except that when I create new route files they don't get filled with the usual boilerplate code. And for the routeTree.gen.ts to be updated I have to kill and restart the vite dev server.
Try creating a new route file - it doesn't get automatically filled with the route boilerplate code
Manually add the code for the new route file - see that you get a TS error from createFileRoute (because the routeTree.gen.ts hasn't been properly updated) until you kill and restart the vite dev server
Expected behavior
automatic filling of route files with boilerplate code should work regardless of root setting in vite config
routeTree.gen.ts should get properly updated when adding/updating route files regardless of root setting in vite config
Screenshots or Videos
No response
Platform
OS: macOS
Additional context
No response
The text was updated successfully, but these errors were encountered:
Which project does this relate to?
Router
Describe the bug
In my vite config, I have
root
set to"./src"
. Initially this resulted in an error from theTanStackRouterVite
plugin due to it trying to read the routes from./src/src/routes
, but I resolved this by addingroutesDirectory: "./src/routes"
andgeneratedRouteTree: "./src/routeTree.gen.ts"
to the plugin config.With this resulting setup, everything seems to work, except that when I create new route files they don't get filled with the usual boilerplate code. And for the
routeTree.gen.ts
to be updated I have to kill and restart the vite dev server.Your Example Website or App
https://stackblitz.com/edit/tanstack-router-mzkds9em?file=vite.config.js,src%2Findex.html&preset=node
Steps to Reproduce the Bug or Issue
Expected behavior
root
setting in vite configroot
setting in vite configScreenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: