T
TanStack15mo ago
national-gold

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
national-gold
national-goldOP15mo 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
national-gold
national-goldOP15mo ago
Thanks
frail-apricot
frail-apricot15mo ago
did you generate the route tree? probably not. so you need to use the vite plugin (in case you are using vite)
national-gold
national-goldOP15mo 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.
frail-apricot
frail-apricot15mo 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?