Open legendecas opened 3 months ago
Is it an issue with the typescript loader implementation or with sourcemaps?
The problem is with the source map support, but it is only outstanding with an internal loader because the transpiled sources are not visible to users.
With https://github.com/nodejs/node/pull/54283#issuecomment-2283390708, when the source codes containing syntax errors (like yet to be supported ECMAScript syntaxes) are used with the flag
--experimental-tranform-types
, there is no time for--enable-source-maps
to collect source maps and perform stack trace mapping, as it collect source maps information from V8 parse results.For example, if the following snippet is been parsed as JS, the error would be:
However, if it is parsed as TS:
Note that the reported syntax error line number is 7, not 8 as expected.