Skip to content

createLazyFileRoute gets automatically replaced with createFileRoute (virtual file routes) #6396

@PingvinB

Description

@PingvinB

Which project does this relate to?

Router

Describe the bug

createLazyFileRoute gets forcibly replaced with createFileRoute on build.

Your Example Website or App

https://github.com/PingvinB/tanstack-router-virtual-lazy-demo

Steps to Reproduce the Bug or Issue

  1. Clone linked repo
  2. Change createFileRoute to createLazyFileRoute in either src/demo1/index.tsx or src/demo2/index.tsx
  3. Run pnpm build

Expected behavior

I expected createLazyFileRoute to not be forcibly replaced with createFileRoute.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.150
  • OS: Windows
  • Browser: N/A
  • Browser Version: N/A
  • Bundler: vite
  • Bundler Version: 7.2.4

Additional context

I tried renaming index.ts to index.lazy.tsx as suggested in #4950, although, as I understand it, it shouldn't matter when using virtual file routes. Regardless, it didn't fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions