question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breakpoints fail to bind in Node 16 or Chrome 90 in functions with destructured arguments

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
icetbrcommented, Jun 9, 2021

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

1reaction
connor4312commented, Jun 4, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code - Node debugger breakpoints not being hit
I launch the app in a separate terminal and then use the attach to process configuration to hook into it. The attaching works...
Read more >
How to Debug a Node.js Application: Tips, Tricks and Tools
Craig Buckler presents a series of tips, tricks, techniques and tools for debugging a Node.js application.
Read more >
Diff - chromium/src - Google Git
2) Several 'link-in-text-block' tests started failing with > axe-core v3.0.2 (and later). These tests do pass in v3.0.1, but > are disabled ...
Read more >
js-notes.md - GitHub
title: Passing arguments to callback functions tip-number: 16 ... checkout [jsperf](http://jsperf.com/bind-vs-closure-23). title: Node.js - Run a module if ...
Read more >
ECMAScript (ES) 6 - Object Computing, Inc.
babel-node es6-file-path ... function req() { throw new Error('missing argument'); } ... assigning to existing variables using object destructuring,.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found