Reproduce wrong line numbers in stack traces under Node v20 #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reproduces the apparent bug (whether the root cause is in ts-node or in Node itself) that under Node v20.0.0 onwards (EDIT: and now also v18.19.0), line numbers are incorrect in stack traces thrown in TypeScript files, seeming to correspond to a module file stripped of its type declarations.
The CI runner failed to install Node v20 (when that was in run.sh, prior to b551e87).
Once I changed that to v18.19.0, the CI output still reports a bunch of
cp: cannot remove '/usr/local/include/node/v8-locker.h': Permission denied
, but it does seem to finish installing v18.19.0, and the CI output reports the problem I'm reproing (but also some Node internal error/warning):(The CI job still reports green, which is a little misleading, but maybe that's the convention in this repo?)
If you change the Node version to v18.8.2 or earlier, the test passes, i.e. the line number will be correct.