Can't generate route tree
[vite] Internal server error: Failed to resolve import "./routeTree.gen" from "src/index.tsx". Does the file exist?
in a completely normal React Vite project.5 Replies
harsh-harlequinOP•13mo ago
I'm following the guide here https://tanstack.com/router/latest/docs/framework/react/quick-start
Quick Start | TanStack Router React Docs
If you're feeling impatient and prefer to skip all of our wonderful documentation, here is the bare minimum to get going with TanStack Router using both file-based route generation and code-based route configuration:
Using File-Based Route Generation
harsh-harlequinOP•13mo ago
Thanks
afraid-scarlet•13mo ago
did you generate the route tree?
probably not. so you need to use the vite plugin
(in case you are using vite)
harsh-harlequinOP•13mo ago
I was using the vite plugin, but for some reason it wouldn't create the new route tree. If anyone sees this down the line the fix for me was to copy a similar route tree from another project and edit it manually.
afraid-scarlet•13mo ago
sounds strange. and if you remove that file again, it won't re-generate?
was the dev server running?