Skip to content
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 #248

Closed
1 task
sosoba opened this issue Jun 5, 2023 · 1 comment
Closed
1 task

ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE #248

sosoba opened this issue Jun 5, 2023 · 1 comment
Labels

Comments

@sosoba
Copy link

sosoba commented Jun 5, 2023

Bug description

Using process.setUncaughtExceptionCaptureCallback with tsx throws the following error:

Error [ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE]: The `domain` module is in use, which is mutually exclusive with calling process.setUncaughtExceptionCaptureCallback()
    at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at new NodeError (node:internal/errors:399:5)
    at process.setUncaughtExceptionCaptureCallback (node:domain:134:15)
    at <anonymous> (min.ts:1:9)
    at Object.<anonymous> (c:\workspace\dbinstall\min.ts:1:58)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Object.F (C:\workspace\dbinstall\node_modules\tsx\node_modules\@esbuild-kit\cjs-loader\dist\index.js:1:941)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
----------------------------------------
Error: require(`domain`) at this point
    at node:domain:130:28
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/loaders:334:7)
    at requireBuiltin (node:internal/bootstrap/loaders:365:14)
    at node:repl:136:16
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/loaders:334:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/loaders:270:10)
    at loadBuiltinModule (node:internal/modules/cjs/helpers:56:9)
    at ESMLoader.builtinStrategy (node:internal/modules/esm/translators:257:18)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14) {
  code: 'ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE'
}

Reproduction

min.ts:

process.setUncaughtExceptionCaptureCallback(console.error);
tsx ./min.ts

Environment

System:
  OS: Windows 10 10.0.22621
  CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
  Memory: 7.52 GB / 23.84 GB
Binaries:
  Node: 18.16.0 - C:\Programs\nodejs\node.EXE
  npm: 9.5.1 - C:\Programs\nodejs\npm.CMD
npmPackages:
  tsx: ^3.12.7 => 3.12.7

Can you work on a fix?

  • I’m interested in opening a pull request to address this issue.
@privatenumber
Copy link
Owner

🎉 This issue has been resolved in v4.15.1

If you appreciate this project, please consider supporting this project by sponsoring ❤️ 🙏

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants