router icon indicating copy to clipboard operation
router copied to clipboard

autoCodeSplitting on Rsbuild breaks source maps

Open wfjsw opened this issue 9 months ago • 5 comments

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/[email protected]
├── @rsbuild/[email protected]
├── @tanstack/[email protected]
├── @tanstack/[email protected]
├── @tanstack/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

wfjsw avatar Mar 21 '25 21:03 wfjsw

does this only appear with rsbuild? does vite work as expected?

schiller-manuel avatar Mar 21 '25 22:03 schiller-manuel

I tried Vite at the beginning with Stackblitz and it does not seem to suffer from that issue; but sourcemap does not even load there, so it might be different.

wfjsw avatar Mar 22 '25 00:03 wfjsw

@Muromi-Rikka how is the linked issue related?

schiller-manuel avatar Jun 18 '25 17:06 schiller-manuel

@Muromi-Rikka how is the linked issue related?

At that time, I thought this problem was related to this link, but in fact it wasn't. I will open a separate issue to report this problem.

Muromi-Rikka avatar Jun 19 '25 01:06 Muromi-Rikka