T
TanStack13mo ago
harsh-harlequin

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-harlequin
harsh-harlequinOP13mo ago
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-harlequin
harsh-harlequinOP13mo ago
Thanks
afraid-scarlet
afraid-scarlet13mo ago
did you generate the route tree? probably not. so you need to use the vite plugin (in case you are using vite)
harsh-harlequin
harsh-harlequinOP13mo 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
afraid-scarlet13mo ago
sounds strange. and if you remove that file again, it won't re-generate? was the dev server running?

Did you find this page helpful?