TanStack / TanStack/router

autoCodeSplitting on Rsbuild breaks source maps

Open
#3,828 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

package: router-plugin rspack
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 Rspack is used and autoCodeSplitting is enabled, the source map generated does not match the original file. The issue is gone when autoCodeSplitting is disabled.

Your Example Website or App

https://github.com/TanStack/router/tree/main/examples/react/quickstart-rspack-file-based

Steps to Reproduce the Bug or Issue
  1. Add debugger statement to src/routes/index.tsx
  2. Use launch profile on VSCode
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}"
        }
    ]
}
  1. Visit the site and check where it breaks
Expected behavior

The debugger should breaks at the exact point of the debugger statement.

Screenshots or Videos

Image

Image

Platform
  • OS: Windows
  • Browser: Chrome
  • Version: 134.0.6998.118
Additional context
tanstack-router-react-example-quickstart-rspack-file-based@ D:\router\examples\react\quickstart-rspack-file-based
├── @rsbuild/core@1.2.4
├── @rsbuild/plugin-react@1.1.0
├── @tanstack/react-router-devtools@1.114.27
├── @tanstack/react-router@1.114.27
├── @tanstack/router-plugin@1.114.27
├── @types/react-dom@19.0.4
├── @types/react@19.0.12
├── autoprefixer@10.4.21
├── postcss@8.5.3
├── react-dom@19.0.0
├── react@19.0.0
├── tailwindcss@3.4.17
└── typescript@5.8.2

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

Reproduce the issue in examples/react/quickstart-rspack-file-based using Rspack with autoCodeSplitting enabled. Start with src/routes/index.tsx and the provided VS Code Chrome launch profile, then compare the debugger location with the debugger statement; done means source maps pause at the exact original source position.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.