microsoft / vscode-chrome-debug-core

A library for implementing VS Code debug adapters for targets that implement the Chrome Debugging Protocol.
Other
157 stars 119 forks source link

Variable hovers sometimes stop showing up #535

Closed eamodio closed 5 years ago

eamodio commented 5 years ago

Sometimes during a debugging session, variable hovers will stop showing up. On one of those occasions I noticed the following in the Debug Output pane

Error processing "variables": TypeError: Cannot destructure property `variables` of 'undefined' or 'null'.
    at ChromeDebugAdapter.<anonymous> (c:\Users\Eric\.vscode-insiders\extensions\msjsdiag.debugger-for-chrome-4.12.1\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:1167:19)
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\Eric\.vscode-insiders\extensions\msjsdiag.debugger-for-chrome-4.12.1\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:7:58)
Error processing "variables": TypeError: Cannot destructure property `variables` of 'undefined' or 'null'.
    at ChromeDebugAdapter.<anonymous> (c:\Users\Eric\.vscode-insiders\extensions\msjsdiag.debugger-for-chrome-4.12.1\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:1167:19)
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\Eric\.vscode-insiders\extensions\msjsdiag.debugger-for-chrome-4.12.1\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:7:58)
roblourens commented 5 years ago

I am patching the unhandled error but I would appreciate if you can get a log for the next time you see this, because I think it would imply that VS Code is asking for the wrong variables reference at the time, or that the DA has lost the reference.

eamodio commented 5 years ago

Will keep an eye out for it.

eamodio commented 5 years ago

@roblourens It happened again (though I know your fix isn't live yet), here is the log:

vscode-node-debug2.txt

roblourens commented 5 years ago

Thanks! Yeah FYI @isidorn, the DA paused, and sent scopes to vscode, then resumed, then paused again, and vscode sent a variables request for one of the original scopes, when it should have sent a scopes request.

It could be a race, but vscode did ask for the new stackTrace, so it knew that the DA was paused again at that point.

isidorn commented 5 years ago

We update the variables tree with a slight timeout, so that could in theory explain this.

roblourens commented 5 years ago

It sounds like something changed though, because I don't remember seeing this before, and now it has been reported a few times.

isidorn commented 5 years ago

I did an rewirte from Promises to async/await, that might have caused some timing issue in theory. Though if there are steps that would be great

roblourens commented 5 years ago

It doesn't sound like anyone is able to repro it 100% consistently but there is a log above if it helps.

Elias-Graf commented 5 years ago

Edit 2 Just checked the console and this might be related (no idea if it helps)? ERR File not found (/Contents/Resources/app/extensions/ms-vscode.node-debug2/node_modules/vscode-chrome-debug-core/out/src/chrome/chromeDebugAdapter.js): Error: File not found (/Contents/Resources/app/extensions/ms-vscode.node-debug2/node_modules/vscode-chrome-debug-core/out/src/chrome/chromeDebugAdapter.js) at S.resolve (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1555:706)

Edit Nope, nevermind now it's gone... weird.

I'm having the same issue but not consistent. I will see how I can replicate it, but in my case, it seems to occur after (quite some time) the actual code throws an error.