You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Source maps map the correct line even if the file has a newline (Which gets removed by tsc)
Actual Behavior
On Node 20.1 the mapping excludes the newlines.
Steps to reproduce the problem
Run the repro repoyarn run test on Node 20.1 and Node 19 and observe the difference in stack locations for the thrown error.
Node 20.1:
Error: Error
at file:///Users/richard/git/tsnodesourcemaptest/index.ts:7:7
at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
Node 19:
Error: Error
at file:///Users/richard/git/tsnodesourcemaptest/index.ts:12:7
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
There is also a test-js script included which will compile and run the output JS file with --enable-source-maps. In this case the source map is correct on both versions.
Search Terms
sourcemap, source map, 20
Expected Behavior
Source maps map the correct line even if the file has a newline (Which gets removed by tsc)
Actual Behavior
On Node 20.1 the mapping excludes the newlines.
Steps to reproduce the problem
Run the repro repo
yarn run test
on Node 20.1 and Node 19 and observe the difference in stack locations for the thrown error.Node 20.1:
Node 19:
There is also a
test-js
script included which will compile and run the output JS file with--enable-source-maps
. In this case the source map is correct on both versions.Minimal reproduction
https://github.com/richardsimko/ts-node-sourcemap-bug
Specifications
The text was updated successfully, but these errors were encountered: