vscode-js-debug: Breakpoints fail to bind in Node 16 or Chrome 90 in functions with destructured arguments

Describe the bug If a file contains two nested anonymous functions with parameters in Node 16 it’s impossible to set a breakpoint on the inner function. Minimal example here: https://github.com/richardsimko/vscode-debugger-issues

if you run the code with npm run start and try to use any of the debug targets to attach to the process it becomes impossible to set a breakpoint on line 5 of index.js.

To Reproduce Steps to reproduce the behavior:

  1. git clone git@github.com:richardsimko/vscode-debugger-issues.git
  2. npm run start
  3. Launch debug target
  4. Try to set breakpoint in the inner function

Log File

I’ve attached a log file of me launching the debug config, trying to add the breakpoint and quitting the debug config.

VS Code Version: 1.56.2

Additional context Possibly related to using type: module, but I’m not sure. It works on any node versions <16 and I couldn’t find anything specific to neither the debugger nor ESM in the patch notes.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I think this is the MR we’re waiting for. https://github.com/nodejs/node/pull/38273

Please verify the warning is present; 16.3 was just released on Thursday and I don’t plan to push candidate fixes for this (or future) releases. It’s a helpful hint to exist, but Node will continue releasing updates and I will patch for them on our normal release cadence.