microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.81k stars 29.12k forks source link

Hover shows undefined while debugging #225618

Closed Alexios11 closed 2 months ago

Alexios11 commented 2 months ago

Type: Bug

Debug an angular project and place a breakpoint within an async function. Once execution stops at the breakpoint hover over any local variable within that async function. The tooltip shows undefined. This happens in version 1.91. I downgraded back to 1.90 and it works fine again.

If I place that variable in the watch window, its value shows properly. If I console.log() that variable I also see the proper value. This seems to only be an issue in async functions.

VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:34:26.404Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (6 x 3696)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.94GB (6.46GB free)| |Process Argv|--crash-reporter-id 47d6066f-9eba-44c4-aaac-4a576619c640| |Screen Reader|no| |VM|0%|
Extensions (3) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.5.0 Lua|key|0.0.9 LiveServer|rit|5.7.9
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 724cj586:31013169 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl1:31104043 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31111718 wkspc-ranged-t:31111713 ```
vs-code-engineering[bot] commented 2 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

connor4312 commented 2 months ago

Please update your VS Code version to get the fix.

Alexios11 commented 2 months ago

Please update your VS Code version to get the fix.

The latest version (1.92.1) is the one having this issue. As I mentioned in my original post I had to downgrade to a version that does not have this issue and that's why the version in my report says "1.90.2", it was added automatically by the reporter. The downgraded version is just the one I used when I clicked on the Report Issue item in the Help Menu. In 1.90.2 it works fine.

PS: You marked this as duplicate, can I have a link to the duplicate report ?

Thanks!

connor4312 commented 2 months ago

Could you grab a log file?

/jsDebugLogs

vs-code-engineering[bot] commented 2 months ago

Please collect trace logs using the following instructions:

If you're able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.

⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to connor@xbox.com

Alexios11 commented 2 months ago

I don't know how to do that or where to put this "/jsDebugLogs" you mentioned. I added "trace": true as the bot suggested but didn't get any report in the Debug Console. I see some log files under AppData\Roaming\Code\logs but they don't contain much, plus there are older folders in there as well which suggests that adding "trace": true just now is not what caused them to be created.

The way I am debugging is by using "request": "attach", "type": "chrome" in my launch.json, then I place a breakpoint and hit "Start Debugging". The application is being run in CEF. When the breakpoint is reached I just hover over any local variable and see "undefined" in the tooltip. To stop the process I just ctrl+c in the terminal. Not sure at which point during this process and how I can get a log of that.

PS: Some additional info: I tested 1.91 as well and looks like that this is where the issue started. In the release notes I see that there were some changes to the Javascript debugger and the functionality when hovering over a variable which seems very suspicious in causing this.

andyfisher100 commented 2 months ago

I have also just noticed this same issue. Im using VS Coe 1.92.2 on macOS Sonoma 14.6.1. Hover shows he variable as undefined during debugging but on the locals shows the variables with the value

connor4312 commented 2 months ago

@andyfisher100 please collect a log file using the above instructions, thanks!

ennovative-pl commented 2 months ago

I also have this issue. Extremely annoying while debugging some errors in tight deadlines... 1.91 here

connor4312 commented 2 months ago

@ennovative-pl please collect a log file using the above instructions, thanks!

Also note that your issue may already be fixed if you update to 1.92

Alexios11 commented 2 months ago

@connor4312 Can you provide some help on how to create a log file for such an issue ?

connor4312 commented 2 months ago

https://github.com/microsoft/vscode/issues/225618#issuecomment-2289771246, you'll see a path like this:

image
Alexios11 commented 2 months ago

@connor4312 Well, I don't. All I see in the debug log is the message that comes from the angular project which is "Angular is running in the development mode. Call enableProdMode() to enable the production mode."

At no point during this process I get any other message in the Debug Console. There must some other pre-requisite for this to work. What is this "preview" debug extension I see in you log ? Maybe I need that extension for this to work ?

satheesh-anecure commented 2 months ago

same with me in the recent build, variables are showing undefined while hovering, but shows up the correct value in variables panel

connor4312 commented 2 months ago

@satheesh-anecure please collect a log file using the above instructions, thanks!


All I see in the debug log is the message that comes from the angular project which is "Angular is running in the development mode.

What does your launch.json look like?

ayortanli commented 2 months ago

Hey @connor4312 Having the same issue with 1.92.2. I've sent log file to connor@xbox.com

connor4312 commented 2 months ago

Much appreciated! Your issue should be solved on the nightly extension: https://github.com/microsoft/vscode-js-debug?tab=readme-ov-file#nightly-extension Which will also release to stable next week

Please let me know if not