T
TanStack•3w ago
stormy-gold

I deleted routeTree.gen.ts and now cannot re-generate it

In TS Router, I've deleted the generated routeTree.gen.ts in hope that re-generating it would resolve some bugs. But the bun dev that is supposed to generate the file now gives me error Pre-transform error: Failed to resolve import "./routeTree.gen" from "src/main.tsx". Does the file exist?. Is there special command that I could use to initially generate the file?
5 Replies
deep-jade
deep-jade•3w ago
try bun run build i expect the same issue, but we never know
stormy-gold
stormy-goldOP•3w ago
The same issue...
vite v7.2.0 building client environment for production...
āœ“ 4 modules transformed.
āœ— Build failed in 46ms
error during build:
Could not resolve "./routeTree.gen" from "src/main.tsx"
vite v7.2.0 building client environment for production...
āœ“ 4 modules transformed.
āœ— Build failed in 46ms
error during build:
Could not resolve "./routeTree.gen" from "src/main.tsx"
deep-jade
deep-jade•3w ago
if it doesnt work, try deleting node_modules, dist, .output, and other build dirs + can you provide your vite config ? might be a plugin order issue now that i think about it
stormy-gold
stormy-goldOP•3w ago
I've deleted the node_modules and reinstalled, and now bun dev showed be different error, about conflicting routes. I've deleted one of index.tsx files that caused the conflict, and was able to run this time! @notKamui thank you for nudging me in right direction šŸ™
deep-jade
deep-jade•3w ago
nice

Did you find this page helpful?