-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
Version
v20.15.0
Platform
Linux fedora 6.9.6-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 21 15:48:21 UTC 2024 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Google Chrome: Version 126.0.6478.126 (Official Build) (64-bit)
OS: Fedora Linux 40 (Workstation Edition)
- Create the following files:
loader-hooks/loader.js
export async function initialize() {
}
export async function resolve(specifier, context, nextResolve) {
return nextResolve(specifier, context);
}
export async function load(url, context, nextLoad) {
return nextLoad(url, context);
}
loader-hooks/registration.js
import url from 'node:url'
import { register } from 'node:module';
const __filename = url.fileURLToPath(import.meta.url);
register(`./loader.js`, url.pathToFileURL(__filename));
build.js
console.log("success");
- Install nvm, so you can switch between NodeJS 18 and NodeJS 20.
- Run the following commands from your directory:
nvm use 18
node --import ./loader-hooks/registration.js ./build.js
node --inspect-brk --import ./loader-hooks/registration.js ./build.js
-
When the debugger for the last command is available, in Google Chrome, visit chrome://inspect/#devices . You should have a Target link for
./build.js
available. Click it, and observe the Chrome DevTools window. The Play button should be active. You can hit Play and the debugging session will finish cleanly. -
Close the Chrome Developer Tools window, to terminate the debugging session.
-
Run the following commands from your directory:
nvm use 20
node --import ./loader-hooks/registration.js ./build.js
node --inspect-brk --import ./loader-hooks/registration.js ./build.js
- Repeat step 4.
This time you will not have a Play button. The Developer Tools window is stuck, unable to proceed.
The only difference here is Node 20 versus Node 18.
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
The Developer Tools in Google Chrome should be able to step through the code. This worked when using Node 18 as the debuggee.
What do you see instead?
No ability to step through code or inspect variables. The Developer Tools are unusable and the NodeJS process is presumably waiting for the Developer Tools to step forward..
Additional information
I do not know if this is a Google Chrome bug or a NodeJS bug. Somewhere between the two, the debugging handshake fails.