Skip to content

Debuggers cannot set breakpoints in certain Node.js internals #51067

Open
@connor4312

Description

@connor4312

Version

21.4.0

Platform

Darwin mbp.peet.io 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/RELEASE_X86_64 x86_64

Subsystem

inspector

What steps will reproduce the bug?

  1. Have a script containing setTimeout(() => {}, 0); setTimeout(() => {}, 0)
  2. Debug the script in your choice of debugger.
  3. Step into setTimeout and set a breakpoint in `timers. Continue.

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

100%

What is the expected behavior? Why is that the expected behavior?

The breakpoint should bind and the debugger should pause in the next call to setTimeout()

What do you see instead?

The debugger doesn't pause and the process exits

Additional information

  • Chrome devtools will set the breakpoint via Debugger.setBreakpointByUrl , but setting the breakpoint by the script ID (Debugger.setBreakpoint) of timers also does not work, returning error -32000 "Could not resolve breakpoint"
  • This regressed between Node 14 and Node 16
  • This appears to only affect scripts loaded into executionContextId: 0. Breakpoints in other scripts, such code in crypto, work without issue.
  • Potentially related to Scripts are sent in a non-existent executionContextId #47438

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions