TanStack / TanStack/router

`enableRouteGeneration: false` also disables `autoCodeSplitting`

Open
#5,087 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Router

Describe the bug

When using the Vite plugin, if you set enableRouteGeneration: false (for instance if you don't want to generate routes when building since they shouldn't be changing) and autoCodeSplitting: true, then it won't automatically code split the built version.

Your Example Website or App

N/A

Steps to Reproduce the Bug or Issue
  1. Set enableRouteGeneration: false and autoCodeSplitting: true
  2. Build the application and routes won't be split automatically, you need to use .lazy
Expected behavior

I expect to have automatic code splitting regardless of what is set for enableRouteGeneration

Screenshots or Videos

No response

Platform
  • Router / Start Version: 1.131.35
  • OS: Windows
  • Browser: N/A
  • Browser Version: N/A
  • Bundler: Vite
  • Bundler Version: 7.1.4
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Vite plugin entry point where enableRouteGeneration and autoCodeSplitting are handled. Reproduce the issue with route generation disabled and automatic code splitting enabled, then build the application. Done means automatic code splitting still occurs without requiring .lazy.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.