-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
「captureRejections」 property not works in ts-node #1587
Comments
captureRejections doc |
I'm unable to reproduce this. Usually when that happens, it means the reporter was making an honest mistake. I've labelled this issue "needs more information" and I'll close in a few days if I don't hear back. |
I tried the code above on online runtime node.js again and it reproduced(node -v 14.x), 「captureRejections」property is setted with value true, the same result with my local test. So, first question is should ts-node works the same with node in 「experimental features」? |
Sounds like you've narrowed this down to a bug in the behavior of whatever version of |
emm, it's just a clue when i saw your reply and tried again. Cause i guess, if you reproduced this code with node REPL then it's not right. I tried with node version 12-17, it works fine with what i expected is that then i run this code with |
I see, you are saying that the node REPL exhibits this bug? Then it is a node bug? I modified your
And the bug reproduces on the latest node v17.3.0:
|
exactly! I agree that it's a node bug. And i don't know how |
When ts-node is loaded, it requires node's built-in Lines 29 to 34 in aff9bb9
Lines 4 to 9 in aff9bb9
This bug is triggered merely by Because this is a node bug, I'm going to close this issue. Good luck! |
I can confirm this is a node bug as well. Has anybody created an issue upstream? |
Oh I found it nodejs/node#41391 |
Search Terms
I wanna create a eventEmitter with 「captureRejections」
it works in with node.js
but not works with ts-node
Expected Behavior
create a eventEmitter instance with able to capture promise rejections with ts-node
Actual Behavior
「captureRejections」property not work with ts-node
but works with node
Steps to reproduce the problem
create a file testEvent.js
run
check console output
[Symbol(kCapture)]: false means 「captureRejections」property is not setted
however, when i use node
run
console output
[Symbol(kCapture)]: false means 「captureRejections」works
this is so confusing
Minimal reproduction
Specifications
ts-node version: v10.4.0
node version: v14.15.0
TypeScript version: 4.4.4
tsconfig.json, if you're using one: not use
Operating system and version: macos 10.15.5 (19F101)
The text was updated successfully, but these errors were encountered: