Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-attach broken #931

Closed
ilanc opened this issue Mar 3, 2021 · 7 comments
Closed

auto-attach broken #931

ilanc opened this issue Mar 3, 2021 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@ilanc
Copy link

ilanc commented Mar 3, 2021

Describe the bug
The auto-attach feature is not working for me. It used to work but stopped working about 2 weeks ago. node --inspect-brk works - but requires you to hit F5 twice - once to attach the debugger, once to start running - which is sub-optimal :)

I'm running ubuntu 18 - haven't had an opp. to try ubuntu 20. I don't have other machines to try on.

To Reproduce

using auto-attach

git clone https://github.com/ilanc/debugger.git
cd debugger
code .
# set a breakpoint in ./app.js
node --inspect app.js # <= auto-attach set to always in .vscode/settings.json - but doesn't

using IDE

  • in vscode > debugger
  • pick "Launch Program"
  • run
  • should hit breakpoint - but doesn't

Log File

added 2 files:

VS Code Version:

Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:48:44.518Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 5.4.0-66-generic

Additional context
Add any other context about the problem here.

@ilanc ilanc added the bug Issue identified by VS Code Team member as probable bug label Mar 3, 2021
@ilanc
Copy link
Author

ilanc commented Mar 3, 2021

here's another log file - nb this one creagted from node --inspect-brk and is much longer.
vscode-debugadapter-16038aa9.json.gz

@connor4312
Copy link
Member

I'm not able to reproduce this issue. From what you're saying it sounds like Node may not be waiting for the debugger to initialize before executing. Since you're using nvm, it would be easy to try a more recent 14.x release -- can you do so?

@connor4312 connor4312 added the info-needed Issue requires more information from poster label Mar 3, 2021
@ilanc
Copy link
Author

ilanc commented Mar 4, 2021

Howdy, I tried with lts i.e. node 14.16.0 and same issue

@ilanc
Copy link
Author

ilanc commented Mar 4, 2021

Ah man - I tried to record a screencast and now its working. FFS. No idea what changed. You can close this issue.

@ilanc ilanc closed this as completed Mar 4, 2021
@ilanc
Copy link
Author

ilanc commented Mar 30, 2021

Hi @connor4312, I've got some more info on this.

nvm worked initially, then stopped working after a while for no apparent reason. I've been getting by with --inspect-brk for a bit, but that stopped working today.

I tried a new approach - I removed nvm and installed node directly. It's working now, but - here's the clincher - i see a suspicious looking icon in the terminal (exclamation mark in top right corner) which I fear to press. Here's the full text of the popup on that icon:

Extensions want to make the following changes to the terminal's environment:

VSCODE_INSPECTOR_OPTIONS=${env:VSCODE_INSPECTOR_OPTIONS}:::{"inspectorIpc":"/tmp/node-cdp.8434-1.sock.deferred","deferredMode":true,"waitForDebugger":"","execPath":"/usr/bin/node","onlyEntrypoint":false,"autoAttachMode":"onlyWithFlag"}
Relaunch terminal

Here's a screenshot:
Screenshot from 2021-03-30 11-58-49

I think this could be our culprit. I'm not pushing that icon until I know how to un-fix it if it winds up breaking my debugger. What are the VSCODE_INSPECTOR_OPTIONS? and where are they saved?

@connor4312
Copy link
Member

The VSCODE_INSPECTOR_OPTIONS are set by the debugger and are required to hook up auto attach. It should not break auto attach.

@ilanc
Copy link
Author

ilanc commented Mar 30, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants