microsoft / vscode

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

Installing VSCode v1.86 broke debug breakpoints #204784

Closed brucejo75 closed 8 months ago

brucejo75 commented 8 months ago

Does this issue occur when all extensions are disabled?: Yes/No Yes still occurs with all extension disabled

Steps to Reproduce:

  1. Install v1.86.1
  2. Run node process, connect VSCode as debugger, try to set a breakpoint.
  3. Note that breakpoints have empty circle not red dot.

Notes

  1. There is a new panel, loaded scripts, that is empty.

  2. Node debugging with Chrome works fine. I set a breakpoint in Chrome debugger separately. Noticed that my connected session in VSCode also hit the breakpoint and highlighted the correct line of code.

I think the debugger simply lost the path to my code for setting breakpoints.

My "launch.json" config ```json { "name": "Meris.meris", "port": 5838, "request": "attach", "skipFiles": [ "/**" ], "type": "node", "sourceMaps": true, "remoteRoot": "${workspaceFolder}/meris", "localRoot": "${workspaceFolder}/meris", "sourceMapPathOverrides": { "meteor://💻app/packages/*": "${workspaceFolder}/packages/*", // Example: "meteor://💻app/main.ts" -> "c:/code/main.ts" "meteor://💻app/*": "${workspaceFolder}/meris/*" // Example: "meteor://💻app/main.ts" -> "c:/code/main.ts" }, }, ```

Workaround

go back to v1.85. All works fine.

Had to uninstall GitHub CoPilot to get CoPilot working again. (yeah, I know another issue)

brucejo75 commented 8 months ago

OK, went back and verified that v1.86.1 still fails. And I updated all the comments in the initial issue comment.

sebestindragos commented 8 months ago

Up! Also facing this issue, my entire day went down the drain trying to figure out why they are not working

sebestindragos commented 8 months ago

@brucejo75 downgrading to 1.85.2 until this is fixed, works on my end. You can get it from here https://code.visualstudio.com/updates/v1_85

roblourens commented 8 months ago

/jsDebugLogs

DavidKirn commented 8 months ago

The breakpoints work for me, but sometimes the debug control panel grafik disappears during debugging even though the debug session is still running. Only after a vs code restart everything works normally again. But then the error occurs again after an undefined time or action.

brucejo75 commented 8 months ago

Here is the log.

What I did:

  1. connected to my node server.
  2. set a breakpoint at a location I know I was going to hit (the breakpoint showed up as an unfilled grey circle, not red circle)
  3. Ran my code

Expected: breakpoint to be hit Actual: no breakpoint hit

Log file: vscode-debugadapter-d7a9e62e.json.gz

connor4312 commented 8 months ago

In the log you provided, you set breakpoints in files named handler.js, server.js, and upload.js, however I'm not seeing any files with these names get loaded by your program -- the breakpoints show as unverified unless the associated source gets loaded.

Are you able to share a log from 1.85 as well so I can see how things 'should' be working?

brucejo75 commented 8 months ago

Hi @connor4312,

BTW:This is debugging WSL node program via a remote connection...

Ran the same test on v1.85.2. This time the breakpoint in handlers.js was hit.

Log file: vscode-debugadapter-ac6fd48a.json.gz

connor4312 commented 8 months ago

Thanks. I'm actually not sure why it was working before; it shouldn't have been. You should be able to resolve this by setting "resolveSourceMapLocations": null in your launch.json.

It seems like meteor sets the URL of compiled files, not just source files (e.g. meteor://💻app/packages/meris.data-tables.js is the URL in the scriptParsed event.) We could solve this in the debugger by applying sourceMapPathMappings to scripts with sourceURL's as well as sourcemaps. I think that should be quite safe.


I see several 👍 's on the issue, but unless you're using Meteor it's unlikely you're hitting the same problem; please open separate issues if that's the case.

brucejo75 commented 8 months ago

That does the trick! Works for both 1.85 & 1.86.

Thanks @connor4312!

FIX

add "resolveSourceMapLocations": null to my launch.json.

connor4312 commented 8 months ago

I'll keep this issue open to track the fix I mentioned that we could do on the debugger side