Esbuild: bad source maps with code splitting

Created on 30 Jul 2020  路  2Comments  路  Source: evanw/esbuild

I am observing incorrect source maps when code splitting is enabled. The filenames and line numbers in the source maps are all wrong, and in some cases the line numbers are out of bounds of the referenced file. This happens with or without minification, but without code splitting all source maps are correct. The project I am observing this on has dozens of entrypoints and tens of thousands of lines of typescript. I tried to make a small, reproducible example, but with simple code and a small number of entrypoints, all source maps were correct. I am not sure what could be triggering this problem. Any ideas?

Most helpful comment

@evanw thank you so much for fixing this issue! I just tested it and everything works perfectly.

All 2 comments

Thank you very much for reporting this. You're right, they were completely wrong. I wasn't taking into account the injected cross-chunk import statements. That should be fixed in version 0.6.13 along with a lot of other source map stuff (I did a lot of testing and found some other issues too). You can read about what I fixed in the release notes.

@evanw thank you so much for fixing this issue! I just tested it and everything works perfectly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

egoist picture egoist  路  3Comments

ayox picture ayox  路  4Comments

mohsen1 picture mohsen1  路  3Comments

aelbore picture aelbore  路  4Comments

vforsh picture vforsh  路  3Comments