Skip to content

Still something wrong: route.tsx and index.tsx conflict when using virtual routing and physical() #6271

@bhscer

Description

@bhscer

Which project does this relate to?

Router

Describe the bug

There is already a issue #5421 and fixed by #6252 , but my project still throw a conflict error.

My project's structure is like this:

src
│  main.tsx
│  routes.ts
│  routeTree.gen.ts
│  styles.css
└─routes
    │  __root.tsx
    └─a_path
            index.tsx
            route.tsx

Virtual file routes config:

export const routes = rootRoute("__root.tsx", [
    physical("", "a_path")
]);

Running such a projects shows a error in broswer:

 Uncaught Error: Invariant failed: Duplicate routes found with id: __root__

Your Example Website or App

https://github.com/bhscer/tanstack-route-conflict

Steps to Reproduce the Bug or Issue

start the project using pnpm i && pnpm dev

then open the broswer and the console will show the error

Expected behavior

expect a good page without error

Screenshots or Videos

No response

Platform

  • Router / Start Version:1.144.0
  • @tanstack/router-plugin: 1.145.2
  • @tanstack/virtual-file-routes: 1.141.0
  • OS: Windows
  • Browser: Chrome
  • Browser Version: 143.0.3650.96

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions