-
-
Notifications
You must be signed in to change notification settings - Fork 541
Open
Description
Search Terms
Node 20, reportTSError, error
Expected Behavior
When using the ts-node/esm
loader with Node 18, TS errors are reported correctly. The file below when run with node --experimental-loader ts-node/esm test.ts
const a = (b: 1 | 2) => b + 1
console.log(a(3))
produces the following correct error:
TSError: ⨯ Unable to compile TypeScript:
test.ts:3:15 - error TS2345: Argument of type '3' is not assignable to parameter of type '1 | 2'.
3 console.log(a(3))
<stack trace>
diagnosticCodes: [ 2345 ]
Actual Behavior
On Node 20, the error is serialised to only retain diagnosticCodes
and no other info
node:internal/process/esm_loader:42
internalBinding('errors').triggerUncaughtException(
^
{ diagnosticCodes: [ 2345 ] }
Likely related to https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#custom-esm-loader-hooks-run-on-dedicated-thread
Steps to reproduce the problem
Run command above on Node 20
Minimal reproduction
https://github.com/TypeStrong/ts-node-repros/actions/runs/5057165129/jobs/9075579140
Specifications
- ts-node v10.9.1
- node v18.16.0
- TS compiler v5.0.4
and
-
ts-node v10.9.1
-
node v20.2.0
-
TS compiler v5.0.4
-
package.json:
{
"type": "module",
}
- Operating system and version: MacOS 13.4
- If Windows, are you using WSL or WSL2?:
SijmenHuizenga, azasypkin, SPAHI4, jophj, drewfish and 29 more
Metadata
Metadata
Assignees
Labels
No labels