-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnhandledPromiseRejection: ts-node-esm does not display type checking results #2085
Comments
I feel my issue fits into this. ts-node v10.9.1 When I have simple code like import http from 'http'; And I run it via node --loader ts-node/esm bin/test.ts in Node 20. I get the output node:internal/process/esm_loader:40
internalBinding('errors').triggerUncaughtException(
^
[Object: null prototype] {
[Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]]
}
Node.js v20.9.0 When I execute it in Node 18.18.2 I get the output /[...]/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
bin/test.ts:1:1 - error TS6133: 'http' is declared but its value is never read.
1 import http from 'http';
~~~~~~~~~~~~~~~~~~~~~~~~
at createTSError
[...] This is of corse an academic example but also applies for way more complex projects I tried multiple ways of executing |
@TarSzator Your issue is not actually an error; it's a configuration in your |
@jahirvidrio The issue is not that I see an error. The issue is that I not see it when I use Node v20. Meaning that I do not see a proper error message when I use Node v20 |
I'm seeing the same issue as @TarSzator. It seems the problem now also exists in node-18.19.0:
|
Hello TypeScript team! I appear to also be experiencing this with my loader command:
Any help would be appreciated! |
Apologies, team I misinterpreted @cj-christoph-gysin's answer as a confirmation that (all) node 18 minor versions worked and that it was just node 20 -- but didn't know I could simply downgrade from my existing I'm not terribly familiar with node/ts/es6 internals but does that mean it's a problem with the ts-node loader, or could it still be a weird minor version node runtime change? |
Search Terms
esm, node 20, UnhandledPromiseRejection
Expected Behavior
I expect to see the type checking errors displayed in the console when using
ts-node
with esm support, providing information about what went wrong during TypeScript compilation.Actual Behavior
The console output from ts-node-esm does not include information about type checking errors, making it challenging to identify and resolve issues during development. Additionally, Node.js reports the following error:
Steps to reproduce the problem
Minimal reproduction
Just run
ts-node
with esm supportSpecifications
The text was updated successfully, but these errors were encountered: