router icon indicating copy to clipboard operation
router copied to clipboard

Duplicate virtual route generation with nested layout routes

Open Spaubleit opened this issue 1 year ago • 0 comments

Which project does this relate to?

Router

Describe the bug

I have simplified file structure like this: Image 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

  1. 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

Spaubleit avatar Sep 18 '24 10:09 Spaubleit