-
-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: The source map is not working on Sentry #7914
[Bug]: The source map is not working on Sentry #7914
Comments
please provide rspack version |
1.0.5 the latest |
I could send you the buggy soucemap files and mjs files via email or whatever tools but I don't want to share them with public. |
I think this is the same issue as web-infra-dev/rsbuild#3433 we found that source map stopped generated properly since 1.0.1 version (probably after #7647). @cjnoname, you can try the 1.0.0 version of rspack to identify when it was broken. |
Apologies, I haven't had time to test it with version 1.0.1, but I’m quite sure it was working before when I tested it. |
This is a significant issue since Sentry is the primary monitoring tool for many companies, and I hope someone can assist in looking into it. Verifying the issue is straightforward - a single command line should work: npx source-map-explorer index.mjs index.mjs.map |
Hello @cjnoname, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by |
@cjnoname I can't investigate more without any reproductions, maybe you should try upgrade to 1.0.5 to see whether the sourcemap problem is solved |
https://github.com/cjnoname/rspack-reproduce You can find the issue with a simple command: "npm run s". I am not sure if this is the only issue causing the sourcemap to break, or if there might be other issues as well. |
Hey hi, guys 👋 Would like to confirm that the latest v1.0.5 has a broken source map. We upgraded from 0.7.5 to 1.0.3 and noticed an issue with the broken source-map - there is a big % of So we downgraded all |
I’ve put together a minimal reproduction repository last night. While I haven't done something exactly like this before, it should accurately represent the issue. https://github.com/cjnoname/rspack-reproduce run "npm run s" can present this issue. Not sure if it's the only issue on sourcemap or not. |
I am currently investigating this issue. |
@cjnoname Currently, it looks like the issue with the source map is caused by the If the issue persists, there may be other factors causing the source map generation error. Please provide additional repos to reproduce the problem. |
In this repository, you can observe that the source maps generated by SWC cause errors in source-map-explorer. |
Thank you for investigating this issue. I understand that the SWC minifier is also maintained by your team, correct? Could you let us know if there are any plans to address this issue in the near future? We are willing to wait a few days if necessary. We are experiencing poor performance with the Terser Webpack Plugin, which we would prefer not to revert to. Do you have an estimated timeline for a fix? Thanks |
@cjnoname I'm not certain if the issue is actually caused by the SWC minifier. Could you please try using the Terser Webpack Plugin and see if the problem persists? |
@yuzhva Please provide the a demo to reproduce the issue. |
The issue persists even after I turned off the minimizer and disabled output: module. It still occurs. You can easily check it in my repo by adjusting the rspack.config.js file. |
@cjnoname Please don't turn off the minimizer. I've tried this before, and I found that some modules in |
@cjnoname You can see the code in source-map-explorer here: https://github.com/danvk/source-map-explorer/blob/master/src/lib/explore.ts#L208 |
It works, but it's running much slower than before. Could you help me report this issue to SWC? |
@cjnoname Yes. If you can confirm that the issue is caused by the SWC minifier, I will continue to work on it. |
@cjnoname I have released the 1.0.10 version https://github.com/web-infra-dev/rspack/releases/tag/v1.0.10 |
For what's worth, we added |
In It's a bit hard to debug to understand what exactly part of the code does not receive generated source maps: the app code, .mjs modules, or something else 🤷 Will try to debug it more to understand which parts of the source maps are missing... |
@mmazzarolo can you give me a reproduce. |
I've been trying, but I can't produce a "minimal" reproducible example 😔. Out production codebase is pretty big and as @yuzhva mentioned it's hard to determine what's causing the issue and putting it into a minimal reproducible example. I tried using same RSBuild config and some similar npm packages for example, but with no success. |
I will release a new version for rspack today to fix this issue. |
@mmazzarolo I've released a canary version of Rspack To override "@rspack/core": "npm:@rspack/[email protected]" |
@SyMind thanks for looking into ti! I assume you mean to add it as an override/resolution, right? So adding: "resolutions": {
"@rspack/core": "npm:@rspack/[email protected]"
}, If I do that, the install step (using But building fails:
Not sure why. Pinning specific versions of My setup is the following:
|
I'm having the same problem with Sentry sourcemaps, and I think this canary build does not work with @rspack/cli. I keep having unmatched version error, and following the dist code I think @rspack/core thinks its on version 1.0.11, while bindings give the canary version.
|
@SyMind was the fix shipped with |
Can confirm, issue is not resolved on 1.0.12. I guess we will have to wait until the next release. |
@mmazzarolo @hmdoganjf I released the v1.0.13 to fix this issue. |
Yes! It seems resolved, I can see the sourcemaps on sentry. Thank you for your help. |
Thanks @SyMind 🙏 This seems to be fixing the issues so far. But we'll need a bit more time to do a complete check. @cjnoname my understanding from @yuzhva is that the current version (the one with the fix) has a coverage of 77.6% for him. But the coverage with rspack/swc might have never been 100% (even before 1.0.1, which we suspected being the version that introduced the issue). |
Hey guys, I can confirm that the source map is inaccurate, especially as it shows errors on the wrong lines of code. |
if terserPlugin provides complete coverage and swc don't provide, then it's normally a swc minifier bug, we may need more information to investigate swc minifier problem |
I will continue to make efforts on the SWC minifier, trying to bring it to 100%. However, this process might be quite slow. |
@cjnoname we do have the same issue with Terser - errors are shown on the wrong lines of code when Terser is used |
@yuzhva can you give me a reproduce repo? |
System Info
System:
OS: macOS 15.0
CPU: (10) arm64 Apple M1 Max
Memory: 2.03 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.8.0 - ~/.nvm/versions/node/v22.8.0/bin/node
npm: 10.8.3 - ~/.nvm/versions/node/v22.8.0/bin/npm
bun: 1.1.27 - /usr/local/bin/bun
Browsers:
Chrome: 128.0.6613.138
Safari: 18.0
Details
The source maps stopped working on Sentry. After discussing with their team, we identified that the issue was caused by an invalid source map generated by Rspack.
When testing the source map with source-map-explorer or other tools, the following error appeared:
'Your source map refers to generated column 53099 on line 39, but the source only contains 53098 columns on that line. Please verify that you are using the correct source map.'
Approximately 70% of the source map files we tested are working, while 30% have failed.
Reproduce link
No response
Reproduce Steps
https://github.com/cjnoname/rspack-reproduce
npm run s
The text was updated successfully, but these errors were encountered: