web-infra-dev / rsbuild

The Rspack-based build tool. It's fast, out-of-the-box and extensible.
https://rsbuild.dev/
MIT License
1.77k stars 139 forks source link

[Bug]: Configuring sourceMap: { js: 'source-map' } in the production environment cannot decode stack traces. #3447

Closed wendy0512 closed 3 weeks ago

wendy0512 commented 1 month ago

Version

System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz
    Memory: 12.17 GB / 31.71 GB
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @rsbuild/core: ^1.0.4 => 1.0.4
    @rsbuild/plugin-less: ^1.0.1 => 1.0.1
    @rsbuild/plugin-react: ^1.0.2 => 1.0.2
    @rsbuild/plugin-styled-components: ^1.0.1 => 1.0.1

Details

In the output configuration, setting sourceMap: { js: 'source-map' } results in inconsistent source code parsing behavior between the development and production environments, with the production environment not working as expected. The development environment interface is as follows: image image

The production environment interface is as follows: image image

Reproduce link

https://github.com/wendy0512/rsbuild-sourcemap-repro

Reproduce Steps

  1. In the output configuration, set sourceMap: { js: 'source-map' }.

  2. Run rsbuild dev and observe the network resources in the development environment.

  3. Run rsbuild build and observe the network resources in the production environment.

github-actions[bot] commented 1 month ago

Hello @wendy0512. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️

github-actions[bot] commented 1 month ago

As the issue was labelled with need reproduction, but no response in 5 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions. For background, see Why reproductions are required.

由于该 issue 被标记为 "需要重现",但在 5 天内没有回应,因此该 issue 将被关闭。如果你有任何进一步的问题,请随时发表评论并重新打开该 issue。背景请参考 为什么需要最小重现

wendy0512 commented 1 month ago

Minimal reproduction has been added. @chenjiahan

wendy0512 commented 1 month ago

Sorry, after upgrading @rsbuild/core from 1.0.4 to 1.0.8, the example still does not display as expected. @chenjiahan

github-actions[bot] commented 1 month ago

As the issue was labelled with need reproduction, but no response in 5 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions. For background, see Why reproductions are required.

由于该 issue 被标记为 "需要重现",但在 5 天内没有回应,因此该 issue 将被关闭。如果你有任何进一步的问题,请随时发表评论并重新打开该 issue。背景请参考 为什么需要最小重现

GiancarlosIO commented 3 weeks ago

Hi there! It's also affecting modern.js framework. I notice this when trying to implement sentry in my app.

chenjiahan commented 3 weeks ago

Fixed in https://github.com/web-infra-dev/rspack/releases/tag/v1.0.10