-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Source maps off in the line numbers since 0.8.13 and in the file name since 0.8.25 (regression) #638
Comments
I'm having similar troubles. Happy to share my source code privately with you @evanw , just like I did a few months ago |
Thank you for the detailed issue, and for the offer to share source code privately. I did a lot of analysis of source maps on various code bases and I think I have experienced the problem myself, so I shouldn't need a code sample. Fixing this is top priority for me and I hope to have a fix soon. |
Ok I think the issues are now fixed. Please try version 0.8.30 and let me know if it works for you or not. I'm leaving this issue open until you can confirm the fix since I don't have a way to reproduce the specific problems you encountered. I took a little while to fix this because I haven't had a great way of debugging source map problems in the past and I figured it's time to fix that. This issue inspired me to make this: https://evanw.github.io/source-map-visualization/. Now I can actually see what I'm doing so issues like this should be much easier to fix in the future. I believe there were two source map problems, one regression introduced in version 0.7.18 and one in version 0.8.25 (more details are in the release notes). I believe that one of the changes introduced in version 0.8.13 caused the earlier regression to start affecting you. I'm guessing it was the change to rewrite |
@evanw All my sourcemap-related problems seem to be solved with 0.8.30, thank you very much! Also, the generated sourcemap file is much smaller than before (with 0.8.20). It used to be ~50 MB, now it's only 10MB. But I guess that's a result from 0.8.25. Quoted from the changelog: So from my end, everything seems to be fine, thank you again for your quick fixes and the awesome esbuild itself! I've just checked the |
Yes, everything is coming out correctly for me in 0.8.30 - thank you! The |
It’s great to hear that everything is fixed. Sorry for the breakage. Thanks so much for the detailed issue report. |
First off, a big thank you for your impressive project.
While evaluating it a few days ago, I noticed that the mapped file names were off in the source maps, so I ran through a few versions after noticing source map work in your release notes. I found out that it's a regression and was introduced in version
0.8.25
.While going through the preparations for this issue, I noticed that the line numbers were also off by 1-2 lines in my case and could trace it back to version
0.8.13
.For a start, I just wanted to let you know about this, so I only have screenshots to offer in this first step.
What follows is a series of screenshots of the same call situation across versions
0.8.10
to0.8.29
. Of interest for this issue are the three top-most stack entries in the respective images:esbuild 0.8.10 (file name in source mapping good, line numbers on point)
esbuild 0.8.12 (file name in source mapping good, line numbers on point)
esbuild 0.8.13 (file name in source mapping good, line numbers off (see above for correct line numbers))
esbuild 0.8.14 (file name in source mapping good, line numbers off)
esbuild 0.8.15 (file name in source mapping good, line numbers off)
esbuild 0.8.23 (file name in source mapping good, line numbers off)
esbuild 0.8.24 (file name in source mapping good, line numbers off)
esbuild 0.8.25 (file name in source mapping incorrect (should be
shared3.ts
and notLifecycle.js
), line numbers off)esbuild 0.8.26 (file name in source mapping incorrect, line numbers off)
esbuild 0.8.27 (file name in source mapping incorrect, line numbers off)
esbuild 0.8.28 (file name in source mapping incorrect, line numbers off)
esbuild 0.8.29 (file name in source mapping incorrect, line numbers off)
Details
Building/bundling from TypeScript
The
package.json
entry:The mismapped source code comes from a separate package and the maps in that package are generated by TypeScript (
tsc
).That package was static/unmodified through all my test runs here.
The regression introduced in
0.8.13
appears to come from the minification code as the line numbers only come out wrong when I specify--minify
. Using--sourcemap=inline
doesn't make a difference. Version0.8.29
is the same in both regards.The regression introduced in
0.8.25
shows itself irrespective of--minify
in all the versions I tried. So the file names always come out wrong. It's the same when specifying--sourcemap=inline
.I am sorry for putting the two issues into a single issue. Let me know if you'd like me to create a separate issue for one of the two.
Please also let me know how I can be of further assistance. I can't easily share that particular source code publicly, but maybe I can create a minimal repro given some time.
The text was updated successfully, but these errors were encountered: