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.url()/open() does not work if NODE_V8_COVERAGE is set #46110

Closed
connor4312 opened this issue Jan 5, 2023 · 2 comments · Fixed by #46113
Closed

inspector.url()/open() does not work if NODE_V8_COVERAGE is set #46110

connor4312 opened this issue Jan 5, 2023 · 2 comments · Fixed by #46113
Labels
coverage Issues and PRs related to native coverage support. inspector Issues and PRs related to the V8 inspector protocol

Comments

@connor4312
Copy link
Contributor

connor4312 commented Jan 5, 2023

Version

v19.3.0

Platform

Darwin MacBook-Pro-2.guest.corp.microsoft.com 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64

Subsystem

inspector

What steps will reproduce the bug?

$ NODE_V8_COVERAGE=/tmp node -p "inspector.url()"
undefined
$ NODE_V8_COVERAGE=/tmp node -p "inspector.open()"
node:inspector:172
    throw new ERR_INSPECTOR_ALREADY_ACTIVATED();

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

100%

What is the expected behavior?

I would expect, regardless of whether NODE_V8_COVERAGE is set, to be able to inspector.open() if there is no inspector.url(), and then after calling that be able to access inspector.url()

What do you see instead?

If NODE_V8_COVERAGE is set, inspector.url() is undefined but inspector.open() throws an error.

Additional information

Originally reported on microsoft/vscode-js-debug#1507

It looks like new inspector.Session().connect() does still work in case, so we could 'fake' the inspect server as a workaround, but this is a complex hack.

@connor4312 connor4312 changed the title Node.js cannot be inspected if NODE_V8_COVERAGE is set inspector.url()/open() does not work if NODE_V8_COVERAGE is set Jan 5, 2023
@MoLow MoLow added inspector Issues and PRs related to the V8 inspector protocol coverage Issues and PRs related to native coverage support. labels Jan 5, 2023
@MoLow
Copy link
Member

MoLow commented Jan 5, 2023

a workaround (until it is fixed) is adding --inspect :
NODE_V8_COVERAGE=/tmp node --inspect -p "inspector.url()"

@connor4312
Copy link
Contributor Author

Unfortunately in my case, the subprocess with NODE_V8_COVERAGE is spawned by c8, which the VS Code Debugger does not control.

nodejs-github-bot pushed a commit that referenced this issue Jan 29, 2023
PR-URL: #46113
Fixes: #46110
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
ruyadorno pushed a commit that referenced this issue Feb 1, 2023
PR-URL: #46113
Fixes: #46110
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit that referenced this issue Mar 3, 2023
PR-URL: #46113
Fixes: #46110
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit that referenced this issue Mar 3, 2023
PR-URL: #46113
Fixes: #46110
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit that referenced this issue Mar 5, 2023
PR-URL: #46113
Fixes: #46110
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage Issues and PRs related to native coverage support. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants