Skip to content

File based auto code splitting not working with vite on Windows #4428

Closed
@kad5

Description

@kad5

Which project does this relate to?

Router

Describe the bug

On vite + windows, the latest version of tanstack router doesn't split code component automatically when building.
This happens only on vite with windows. when testing on a linux machine, the splitting works correctly.

images for windows and linux builds for the same test repo

Image
Image

Your Example Website or App

https://stackblitz.com/~/github.com/kad5/test-ts-code-splitting

Steps to Reproduce the Bug or Issue

  1. on Windows run "npx create-tsrouter-app@latest my-app --template file-router"
  2. add some dummy routes
  3. npm run build

Expected behavior

previous to the latest update, the chunks were correctly produced. Currently I have another repo that has:
"@tanstack/react-router": "^1.115.2",
"@tanstack/router-plugin": "^1.115.2",
"vite": "^6.2.0"

and it works on windows but the current version 1.121.2 doesn't split on windows with vite 6.

Screenshots or Videos

No response

Platform

  • OS: Windows

Additional context

there was an old issue from 2024 that is similar to this
#2167

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