Report InvalidMappingColumn on tsc generated source map
See original GitHub issueReproduce
$ source-map-explorer test.js
test.js
Your source map refers to generated column 21 on line 1, but the source only contains 21 column(s) on that line.
Check that you are using the correct source map.
test.js
console.log('hello');
console.log('world');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNyQixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDIn0=
Root cause
Typescript emits mappings for end-of-line characters, which breaks the boundary checks in source-map-explorer.
This issue has been reported as https://github.com/microsoft/TypeScript/issues/34695. However, even if it’s fixed in next ts release, there will be code generated by earlier versions of tsc around, that source-map-explorer won’t be able to process.
Moreover, though it doesn’t seem to be an ordinary input to source-map-explorer, such mapping can easily propagate its way to the final bundle and breaks source-map-explorer eventually.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
source-map-explorer: Versions - Openbase
Full version history for source-map-explorer including change logs. ... #136 Report InvalidMappingColumn on tsc generated source map. Internal.
Read more >Troubleshooting Source Maps for JavaScript
Source maps can sometimes be tricky to get going. If you're having trouble, you can try using our verification tool inside sentry-cli ,...
Read more >Using Source Maps - Javascript Honeybadger Documentation
The best way to let us know about your source map is to upload your files to our servers every ... Most modern...
Read more >No source maps files in release mode - Stack Overflow
The Visual Studio "TypeScript Build" section has a checkbox for "Generate source maps" that is tied to the build configuration. Also tsc has...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got
Ubuntu 20, source-map-explorer@2.5.0
Is this likely the line in question?
https://github.com/danvk/source-map-explorer/blob/c007f361a363465437eca94f81e4dfe0152b562f/src/explore.ts#L109