Title: `ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE` after `require('repl')` or `require('domain')` · Issue #48131 · nodejs/node · GitHub
Open Graph Title: `ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE` after `require('repl')` or `require('domain')` · Issue #48131 · nodejs/node
X Title: `ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE` after `require('repl')` or `require('domain')` · Issue #48131 · nodejs/node
Description: 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: node -e 'require("domain"); process.setUncaughtExceptionCaptureCallback(function() {})...
Open Graph Description: 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: node -e 'require("domain"); process.setUncaugh...
X Description: 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: node -e 'require("domain"); proc...
Opengraph URL: https://github.com/nodejs/node/issues/48131
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE` after `require('repl')` or `require('domain')`","articleBody":"### Version\n\n16.20.0, 17.9.1, 18.16.0, 19.9.0, 20.2.0\n\n### Platform\n\nWindows\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nDo either of the following:\r\n\r\n```\r\nnode -e 'require(\"domain\"); process.setUncaughtExceptionCaptureCallback(function() {})'\r\n```\r\n\r\nOr, if you believe the user should not be using the domain module, then it also happens when they import (not use!) \"repl\"\r\n\r\n```\r\nnode -e 'require(\"repl\"); process.setUncaughtExceptionCaptureCallback(function() {})'\r\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nMerely requiring `repl` does not trigger this side-effect, because it is expected that merely requiring -- *not using* -- the repl module would not break `process.setUncaughtExceptionCaptureCallback`\n\n### What do you see instead?\n\n```\r\nError [ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE]: The `domain` module is in use, which is mutually exclusive with calling process.setUncaughtExceptionCaptureCallback()\r\n at new NodeError (node:internal/errors:372:5)\r\n at process.setUncaughtExceptionCaptureCallback (node:domain:125:15)\r\n at [eval]:1:26\r\n at Script.runInThisContext (node:vm:129:12)\r\n at Object.runInThisContext (node:vm:305:38)\r\n at node:internal/process/execution:76:19\r\n at [eval]-wrapper:6:22\r\n at evalScript (node:internal/process/execution:75:60)\r\n at node:internal/main/eval_string:27:3\r\n----------------------------------------\r\nError: require(`domain`) at this point\r\n at node:domain:121:28\r\n at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)\r\n at nativeModuleRequire (node:internal/bootstrap/loaders:341:14)\r\n at node:repl:132:16\r\n at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)\r\n at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)\r\n at loadNativeModule (node:internal/modules/cjs/helpers:49:9)\r\n at Function.Module._load (node:internal/modules/cjs/loader:804:15)\r\n at Module.require (node:internal/modules/cjs/loader:999:19)\r\n at require (node:internal/modules/cjs/helpers:102:18) {\r\n code: 'ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE'\r\n}\r\n```\n\n### Additional information\n\nRelated to https://github.com/TypeStrong/ts-node/issues/2024","author":{"url":"https://github.com/cspotcode","@type":"Person","name":"cspotcode"},"datePublished":"2023-05-23T01:26:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/48131/node/issues/48131"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e2e46d22-e399-1277-b41c-6fa88fa02d90 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA1C:6EB9C:32A6A9:45B312:6A4DC326 |
| html-safe-nonce | a88483a6e3c5fb370c5953a04fbbe0adc58db0e9aca33970e4a46e7d39f031f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTFDOjZFQjlDOjMyQTZBOTo0NUIzMTI6NkE0REMzMjYiLCJ2aXNpdG9yX2lkIjoiMzAyMDcyMDE4MjYwOTY5MTQzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c79d05acfd8bac87e30ce2b8f2e33eeddbf9b99edd2c6cf06e00599a358c4687 |
| hovercard-subject-tag | issue:1720974409 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/48131/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3845c01455f7dca61f2957e80ee27f1d80b5c99be0da8dcd8673c6df7332345/nodejs/node/issues/48131 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3845c01455f7dca61f2957e80ee27f1d80b5c99be0da8dcd8673c6df7332345/nodejs/node/issues/48131 |
| og:image:alt | 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: node -e 'require("domain"); process.setUncaugh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cspotcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width