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

inspector is still using the deprecated domain module #39817

Closed
TheBrenny opened this issue Aug 20, 2021 · 2 comments
Closed

inspector is still using the deprecated domain module #39817

TheBrenny opened this issue Aug 20, 2021 · 2 comments

Comments

@TheBrenny
Copy link

TheBrenny commented Aug 20, 2021

Version

v14.16.1

Platform

Microsoft Windows NT 10.0.19043.0 x64

Subsystem

inspector

What steps will reproduce the bug?

Require the following function.

function inspect() {
    const inspector = require("inspector")
    let host = "127.99.110.101";
    let port = 41946;
    let terminal = "command that opens a windows terminal profile using `node-inspect.cmd ${host}:${port}` as the command";
    inspector.open(port, host, false);
    child_process.exec(terminal);
    inspector.waitForDebugger();
}

Open a NodeJS REPL and run the function.

> inspect()

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior?

No deprecation message.

What do you see instead?

> inspect() // this is the same command from before -- it wasn't run twice
Debugger attached.
undefined
> (node:10080) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
    at emitMakeCallbackDeprecation (domain.js:129:13)
    at process.topLevelDomainCallback (domain.js:140:5)
    at process.callbackTrampoline (internal/async_hooks.js:129:14)
    at Object.inspectorOpen [as open] (inspector.js:139:3)
    at get (C:\Users\TheBrenny\My Space\Util\nodeRepl.js:56:27)
    at REPL1:1:1
    at Script.runInThisContext (vm.js:133:18)
    at REPLServer.defaultEval (repl.js:484:29)
    at bound (domain.js:413:15)
    at REPLServer.runBound [as eval] (domain.js:424:12)

Additional information

Sure, I understand that it is only a warning, but warnings are ugly and they do just that: they warn.

@targos
Copy link
Member

targos commented Aug 21, 2021

I'm pretty sure it's the same as #37445

@TheBrenny
Copy link
Author

I tried so much googling to find out if it was already reported. My bad! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants