router
router copied to clipboard
Duplicate virtual route generation with nested layout routes
Which project does this relate to?
Router
Describe the bug
I have simplified file structure like this:
In a real application each directory contains additional routes.
As you can see I don't have duplicated file routes. But after generation I get duplicated routes in routeTree.gen.ts:
// Create Virtual Routes
const ProtectedSystemsSysIdImport = createFileRoute(
'/_protected/systems/$sysId',
)()
const ProtectedSystemsSysIdSysLayoutEditImport = createFileRoute(
'/_protected/systems/$sysId/_sys-layout/edit',
)()
Why is ProtectedSystemsSysIdImport being created when I already have _public/systems.$sysId.tsx?
Is it possible to restructure my code to fix this issue or is this a problem in generator?
Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-6ambir
Steps to Reproduce the Bug or Issue
-
npm run dev
Expected behavior
I expect to get valid route tree when there are no conflicting route files in the application.
Screenshots or Videos
No response
Platform
- OS: Linux
- Browser: Firefox
- Version: 129.0
Additional context
No response