web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
9.87k stars 571 forks source link

[Bug]: Unable to debug when lazyload. #8021

Open belizariogr opened 1 month ago

belizariogr commented 1 month ago

Version

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor
    Memory: 17.85 GB / 31.21 GB
  Browsers:
    Edge: Chromium (127.0.2651.105)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @rsbuild/core: ^1.0.6 => 1.0.6
    @rsbuild/plugin-react: ^1.0.2 => 1.0.2
    @rsbuild/plugin-svgr: ^1.0.2 => 1.0.2
    @rsbuild/plugin-type-check: ^1.0.1 => 1.0.1

Details

Using version 1.0.x we are unanble to debug when files has more than 50 lines. If I downgrade to version 0.7.x the debug works perfectly.

Reproduce link

https://github.com/belizariogr/rsbuild-error

Reproduce Steps

Run: npm install

go to file: src/pages/Dashboard/index.tsx and try to debug in the last lines, just like the picture.

Captura de tela 2024-09-24 155203

belizariogr commented 1 month ago

Just to add an information: The component is lazy loading just like in the picture down below...

The file responsable to load the page is: src/core/services/UserRouter/index.tsx

Captura de tela 2024-09-24 155716

9aoy commented 1 month ago

It seems to be related to the problem of rspack sourcemap. Try using rspack 1.0.0, the debug works perfectly. 😢

https://github.com/web-infra-dev/rspack/issues/7914

9aoy commented 1 month ago

Unfortunately this problem still exists in rspack v1.0.8. We still need to investigate further.

A bit of helpful information is that changing devtool from source-map to cheap-module-source-map works.

elsassph commented 1 month ago

We have the same problem.

I can confirm that cheap-module-source-map works for development, but not for production.

penggang-home commented 1 month ago

@belizariogr bro, Which theme did you use? Looks good

belizariogr commented 1 month ago

I use https://mui.com/