-
Notifications
You must be signed in to change notification settings - Fork 30k
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
ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE
after require('repl')
or require('domain')
#48131
Comments
There are """reasons""" (not good ones, but old ones) as to why (Istr that there's a plan to get domain out of repl, and that's one of the last few things keeping domain from being fully removed? Maybe along with the lack of an alternative, though at this point, they've been broken enough for long enough that it's probably safe to say no one is using them in a real way.) |
Actually starting the repl will still put the process into domain-mode, but this at least allows programs to use `ts-node` or `--loader=ts-node/esm` without losing the ability to use process.setUncaughtExceptionCaptureCallback(). The problem should ideally be fixed (or mitigated) in node core, but this is still worthwhile for the benefit of supporting current node versions. Re: nodejs/node#48131 Fix: TypeStrong#2024
Actually starting the repl will still put the process into domain-mode, but this at least allows programs to use `ts-node` or `--loader=ts-node/esm` without losing the ability to use process.setUncaughtExceptionCaptureCallback(). The problem should ideally be fixed (or mitigated) in node core, but this is still worthwhile for the benefit of supporting current node versions. Re: nodejs/node#48131 Fix: TypeStrong#2024
* fix: lazy-load repl to avoid domain side effects Actually starting the repl will still put the process into domain-mode, but this at least allows programs to use `ts-node` or `--loader=ts-node/esm` without losing the ability to use process.setUncaughtExceptionCaptureCallback(). The problem should ideally be fixed (or mitigated) in node core, but this is still worthwhile for the benefit of supporting current node versions. Re: nodejs/node#48131 Fix: #2024 * Update src/repl.ts --------- Co-authored-by: Andrew Bradley <cspotcode@gmail.com>
Version
16.20.0, 17.9.1, 18.16.0, 19.9.0, 20.2.0
Platform
Windows
Subsystem
No response
What steps will reproduce the bug?
Do either of the following:
Or, if you believe the user should not be using the domain module, then it also happens when they import (not use!) "repl"
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Merely requiring
repl
does not trigger this side-effect, because it is expected that merely requiring -- not using -- the repl module would not breakprocess.setUncaughtExceptionCaptureCallback
What do you see instead?
Additional information
Related to TypeStrong/ts-node#2024
The text was updated successfully, but these errors were encountered: