Numbers in route folder names break the generated routeTree
Which project does this relate to?
Router
Describe the bug
When using numbers in the folder names, the generated routeTree is broken and looks like this
import { Route as rootRoute } from './routes/__root'
import { Route as IndexImport } from './routes/index'
import { Route as R01SimpleQueryIndexImport } fro./routes/01-simple-query/index/index'
Your Example Website or App
https://stackblitz.com/edit/github-pf7werke?file=src%2Froutes%2F01-example%2Findex.tsx
Steps to Reproduce the Bug or Issue
- create a folder with numbers in it in the routes folder
- create an index.tsx file
- get error
Expected behavior
That the generated routeTree is syntatically correct
Screenshots or Videos
Platform
- OS: macOS
- Browser: Chrome
- Version: 134.0.6998.166
Additional context
No response
You may have been caught in the middle of VSCode interrupting the save of the route-tree file. It's a pretty annoying thing, since VSCode's file watcher interrupts file saves which should be happening in the background, completely transparent to the user.
It's not limits to numbers in the filename. It can randomly happen with normal routes as well. Just to be sure, I've added this as test cases in the router-generator.
That being said, at the moment, there's not much that we can do with how VSCode tries to interrupt these kinds of file saves. I can only recommend adding these settings in the hopes that VSCode respects it.