goja icon indicating copy to clipboard operation
goja copied to clipboard

Add WithSkipEmptySourceMaps parser option

Open dsmith3197 opened this issue 2 months ago • 3 comments

The TypeScript compiler produces empty source map files for source files containing only type definitions.

This PR adds a WithSkipEmptySourceMaps parser option that ignores the empty source map error produced here.

dsmith3197 avatar Oct 10 '25 14:10 dsmith3197

I think the behaviour should be to simply ignore missing or invalid source maps. This will match nodejs and browsers.

dop251 avatar Oct 14 '25 16:10 dop251

I think the behaviour should be to simply ignore missing or invalid source maps. This will match nodejs and browsers.

Are you suggesting that we remove the option altogether and always ignore empty/invalid source maps? Or are you saying that when the option is enabled, we should ignore all errors when parsing the source map?

dsmith3197 avatar Oct 15 '25 20:10 dsmith3197

The former. Both nodejs and the browsers seem to behave this way.

dop251 avatar Oct 15 '25 21:10 dop251