Skip to content

node --inspect-brk unexpectedly skips first line when there are breakpoints set #2338

@Andrej730

Description

@Andrej730

Version: 1.115.0-insider (user setup)
Commit: 3d70aab9a4ed407832e43584ac7a661be08e2d74
Date: 2026-04-03T09:58:58-07:00
Electron: 39.8.5
ElectronBuildId: 13703022
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

  1. Create test.js below in cwd.
  2. Open folder in VS Code.
  3. Ensure there are no breakpoints in VS Code set.
  4. Run node --inspect-brk test.js and use Attach to Node Process.
  5. Expectedly, it stops at the second line.
Image
  1. Now stop debugging and add a breakpoint at line 4.
  2. Run node --inspect-brk test.js and use Attach to Node Process.
  3. Expected - debugger to stop at second line. Instead it ignored the second line and stops at the first breakpoint, line 4.
Image
// test.js
console.log("line 1")
console.log("line 2")
console.log("line 3")

This seems odd, because --inspect-brk is typically described as activate inspector on host:port and break at start of user script.
But in this case it contradicts its description and if breakpoints are set --inspect-brk is indistinguishable from --inspect-wait (activate inspector on host:port and wait for debugger to be attached).

Not sure if it's node issue or debugger adapters, so reporting it here.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions