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

Unbound breakpoint #102493

Closed
billyson opened this issue Jul 14, 2020 · 119 comments
Closed

Unbound breakpoint #102493

billyson opened this issue Jul 14, 2020 · 119 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster

Comments

@billyson
Copy link

Issue Type: Bug

Hi,

After my VS Code updated to the latest version for some reason i can no longer place a breakpoint anywhere in my code.

When i place a breakpoint, it gives the round circle without red and it says "Unbound breakpoint".

This is a little bit disappointed.

Below is the launch.json configuration:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Chrome - CIS5",
"url": "https://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///./": "${workspaceRoot}/"
}
}
]
}

VS Code version: Code 1.47.0 (d5e9aa0, 2020-07-09T08:02:06.629Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2904)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.85GB (4.57GB free)
Process Argv --folder-uri file:///d%3A/CISV5/trunk
Screen Reader no
VM 0%
Extensions (27)
Extension Author (truncated) Version
Bookmarks ale 11.3.1
npm-intellisense chr 1.3.0
path-intellisense chr 2.2.1
bracket-pair-colorizer Coe 1.0.61
dart-code Dar 3.12.2
flutter Dar 3.12.2
vscode-eslint dba 2.1.6
EditorConfig Edi 0.15.1
tortoise-svn fan 0.1.1
vscode-firefox-debug fir 2.9.0
auto-close-tag for 0.5.8
auto-rename-tag for 0.1.4
vscode-peacock joh 3.7.2
csharp ms- 1.22.1
mssql ms- 1.9.0
python ms- 2020.6.91350
powershell ms- 2020.6.0
vscode-typescript-tslint-plugin ms- 1.2.3
debugger-for-chrome msj 4.12.9
vetur oct 0.24.0
tslint-vue pro 1.5.6
vue-vscode-snippets sdr 1.9.0
code-spell-checker str 1.9.0
vscodeintellicode Vis 1.2.9
vscode-icons vsc 10.2.0
vscode-todo-highlight way 1.0.4
JavaScriptSnippets xab 1.8.0

(2 theme extensions excluded)

@inverherive
Copy link

inverherive commented Jul 14, 2020

Also experiencing the same issue with 1.47.0 debugging babel-node

{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/src/index.js",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/babel-node",
"runtimeArgs": ["--nolazy","--trace-deprecation","--trace-warnings"],
}
]
}

Downgrading to 1.46.1 fixes the issue

@cliff-robbins-whcc
Copy link

I am having the same issue with 1.47.0 debugging node js.
I downgraded to 1.46.1 and debugging works again.

"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Prospector",
"program": "${workspaceFolder}/dist/server.js",
"preLaunchTask": "npm: build",
"skipFiles": [
"${workspaceFolder}/node_modules//*.js",
"<node_internals>/
/*.js"
]
}

@connor4312
Copy link
Member

connor4312 commented Jul 14, 2020

@inverherive For babel, see #102152 (comment)

@billyson Please collect a trace log using these 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

@cliff-robbins-whcc if you aren't using Node 8 (#102166 (comment)) please collect a trace log using the instructions above.

/needsMoreInfo

@connor4312 connor4312 self-assigned this Jul 14, 2020
@connor4312 connor4312 added debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster labels Jul 14, 2020
@geisonmcd
Copy link

geisonmcd commented Jul 14, 2020

It's happening to me as well since I updated to 1.47.1 earlier in the day.

edit: just downgraded back to 1.46.0 and the breakpoints are bounding again.

@piazera
Copy link

piazera commented Jul 14, 2020

me too, downgrading to 1.46.1 made it work again.

@connor4312
Copy link
Member

Fyi you can set debug.javascript.usePreview: false to temporarily used the old debugger.

However, please collect trace logs using the instructions above so that your issue can be fixed, as this option will eventually go away.

@billyson billyson reopened this Jul 14, 2020
@billyson
Copy link
Author

Fyi you can set debug.javascript.usePreview: false to temporarily used the old debugger.

However, please collect trace logs using the instructions above so that your issue can be fixed, as this option will eventually go away.

Looks like Debugger for Chrome v 4.12.9 that causes the issue.

@connor4312
Copy link
Member

Yes, this is the version where redirection to the new debugger was established.

@eric-wei1990
Copy link

Upgrade to 1.47.1 today, have same issue.
Seems caused by new js debuger, it is enabled by default.
https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-debug-nightly

This extension is installed by default on all VS Code versions after 1.46.0, however it's not enabled. You can enable it by adding "debug.javascript.usePreview": true to your user settings.

Breakpoint could be bounded after disable debug.javascript.usePreview .

@connor4312
Copy link
Member

@eric-wei1990 please collect a trace log using the instructions given above.

@connor4312
Copy link
Member

@cliff-robbins-whcc thank you for the emailed log. It looks like you're experiencing the same symptoms as the Node 8 issue I linked above (#102166 (comment)). Do those resolution steps work for you?

@cliff-robbins-whcc
Copy link

@connor4312 I was able to get it to work with disable debug.javascript.usePreview.
I plan on installing NVM and using node12 as default.

@eric-wei1990
Copy link

@connor4312
I create a demo(https://github.com/eric-wei1990/vscode-debug-test).
This is log when runing this demo, please check~
vscode-debugadapter-2.json.gz

@connor4312
Copy link
Member

@eric-wei1990 can you see if you continue to experience the problem on the latest nightly?

@eric-wei1990
Copy link

eric-wei1990 commented Jul 16, 2020

@connor4312
Tried latest nightly
disable ms-vscode js-debug
enable ms-vscode js-debug-nightly

This problem still happens, please check this log:
vscode-debugadapter-4.json.gz

By the way, I'm using VS Code Remote Development for developing.

@connor4312
Copy link
Member

connor4312 commented Jul 16, 2020

Is your program actually running? I don't see any output logged, normally at minimum we'd see "Debugger listening on ...". Do you see stuff in the Debug Console?

@eric-wei1990
Copy link

@connor4312
Actully, there is no Debugger listening on .. in DEBUG CONSOLE.
no debug listening on

But the program can runing.
program can runing

@connor4312
Copy link
Member

Interesting. If you add this line to your program, does anything get echoed? console.log(process.env.NODE_OPTIONS, process.env.VSCODE_INSPECTOR_OPTIONS)?

@eric-wei1990
Copy link

Nothing outputed after adding console.log(process.env.NODE_OPTIONS, process.env.VSCODE_INSPECTOR_OPTIONS).
no output

@connor4312
Copy link
Member

connor4312 commented Jul 16, 2020

Okay, last thing -- add "console": "integratedTerminal", to the launch.json and share the output. Either one of two things is happening:

  1. For some reason js-debug isn't setting the environment variables necessary to debug the program
  2. Something in your environment is preventing the debugged process from receiving the variables

When you run it on the internal console, the environment variables will be printed out and set on the command line so we can verify whether they're present.

@eric-wei1990
Copy link

adding "console": "integratedTerminal"
add integratedTerminal

@connor4312
Copy link
Member

Alright, interesting. Looks like the variables are set, but the bootloader isn't triggering debug mode.

I created a special build of js-debug with additional logging if you're able to give it a shot. The additional logs will appear right in the console: https://memes.peet.io/img/js-debug-nightly-for-102492.vsix (Install using the "Install from VSIX" command)

@eric-wei1990
Copy link

Unable to install this vsix(https://memes.peet.io/img/js-debug-nightly-for-102492.vsix)
error happens when install vsix

@connor4312
Copy link
Member

@eric-wei1990
Copy link

console after installing that vsix
console after install 102492

logs
vscode-debugadapter-15.json.gz

@SergioEanX
Copy link

I have the same issue, no way to resolve it even by downgrading to version 1.48.2.
Perhaps I have to delete some cached files? I'm using a Mac.
Running debug I have the following output in the integrated terminal:

/usr/bin/env 'NODE_OPTIONS=--require "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/var/folders/v6/g0ln7hfd0496z_8nxxmzks4h0000gn/T/node-cdp.14425-2.sock","deferredMode":false,"waitForDebugger":"","execPath":"/Users/eanx/.nvm/versions/node/v12.18.0/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/var/folders/v6/g0ln7hfd0496z_8nxxmzks4h0000gn/T/node-debug-callback-b4d42d25cdf9d098"}' /Users/eanx/.nvm/versions/node/v12.18.0/bin/node ./server.js

My lauch.json is the following:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}/server.js",
            "console": "integratedTerminal"
        }
    ]
}

@connor4312
Copy link
Member

@SergioEanX please share your logs as described above so I can help you with your issue.

@jabbera
Copy link

jabbera commented Sep 18, 2020

@connor4312 well that's embarrassing. I've never written an extension before........ :-)

@connor4312
Copy link
Member

Extensions only get activated when some event happens. In the case of the sample, it's only activated when "hello world" is run https://github.com/microsoft/vscode-extension-samples/blob/master/helloworld-sample/package.json#L14-L16 More about extensions: https://code.visualstudio.com/api/get-started/extension-anatomy

@SergioEanX
Copy link

@SergioEanX please share your logs as described above so I can help you with your issue.

I finally resolved the issue by completely removing VS Code from my Mac and reinstalling version 1.46.1.
I think I will wait for a couple of updates before upgrading the actual version of VS Code.
I wasted more than two hours trying to find a solution.
So far I considered VS Code a great IDE.

@connor4312
Copy link
Member

@SergioEanX I would encourage you to share the trace logs so we can get your issue resolved. It should only take a minute or two of your time to collect them, and then you won't be stuck forever on an old version of VS Code 🙂

@nicosefer
Copy link

@nicosefer please share your launch config and/or logs as described above so I can help you with your issue.

@connor4312 Thanks for your support. The problem was solved after upgrading to 1.49.1 this morning

@rsd-raul
Copy link

Hi @connor4312, just found out I'm having the same issue after updating.

I quickly "solved" by tweaking my outFiles to include any files under ${workspaceFolder}, as seems to be the same issue suggested in this response, but mine is a really dirty fix to keep working.

My launch.json is:

{
  "configurations": [
    {
      "name": "Pool - Timetable",
      "type": "node",
      "request": "launch",
      "program": "${workspaceFolder}/node_modules/serverless/bin/serverless",
      "preLaunchTask": "tsc: build - tsconfig.json",
      "outFiles": [ "${workspaceFolder}/**/*.js" ],
      "args": [
        "invoke",
        "local",
        "--function",
        "poolTimetablesConfigLambda",
        "--path",
        "${workspaceRoot}/lambdas/pool_config_lambda/test/request.json"
      ]
    },{
      "name": "Pool - Timetable - No config - Invalid",
      "type": "node",
      "request": "launch",
      "program": "${workspaceFolder}/node_modules/serverless/bin/serverless",
      "preLaunchTask": "tsc: build - tsconfig.json",
      "outFiles": [ "${workspaceFolder}/.build/**/*.js" ],
      "args": [
        "invoke",
        "local",
        "--function",
        "poolTimetablesConfigLambda",
        "--path",
        "${workspaceRoot}/lambdas/pool_config_lambda/test/request-no-config.json"
      ]
    }
  ]
}

The first config works like a sharm, the second one doesn't, it seems to execute perfectly, just doesn't like my breakpoints, any suggestion?

@connor4312
Copy link
Member

Glad to hear you got it working. If you grab a trace log, that will give me enough information about your environment to be able to look into it further.

@rsd-raul
Copy link

Just sent them to your email, thanks a lot.

@connor4312
Copy link
Member

connor4312 commented Sep 18, 2020

Thanks for the logs. It looks like the serverless build creates recursive sourcemaps, which is interesting... so effectively the algorithm sees the recursed source maps as coming from the same paths as your source files, which means that targeting .build only doesn't match them. You have a couple options:

  • Leave the entire directory in your outFiles, or remove outFiles (since this is the default). This is not too bad, the outFiles scanning is quite optimized in recent versions of js-debug.
  • Change your type: pwa-node from type: node, and then add resolveSourceMapLocations: null (or a more specific glob) to tell js-debug to resolve sourcemaps in all or those additional locations.

@rsd-raul
Copy link

Huh, interesting, I thought the scanning would be quite costly, but yeah, I'm not noticing much of a difference, to be honest.

I'll remove outFiles and avoid anything too specific, plus, that's 50+ lines less in a file that keeps getting bigger... Every bit counts :D

Thanks for all the help.

@SergioEanX
Copy link

@SergioEanX I would encourage you to share the trace logs so we can get your issue resolved. It should only take a minute or two of your time to collect them, and then you won't be stuck forever on an old version of VS Code 🙂

Below the trace logs.
Curiously after removing VS Code altogether and after that upgrading to the latest version, the described issue seems to have gone.
Still I receive a long string (shown twice) as below when I start the debugger:

/usr/bin/env 'NODE_OPTIONS=--require "/Applications/Visual Studio Code.app/Cont ents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/var/folders/v6/g0ln7hfd0496z_8nxxmzks4h0000gn/T/node-cdp.1324-1.sock","deferredMode":false,"waitForDebugger":"","execPath":"/Users/eanx/.nvm/versions/node/v12.18.0/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/var/folders/v6/g0ln7hfd0496z_8nxxmzks4h0000gn/T/node-debug-callback-a17564fb3728c92b"}' /Users/eanx/.nvm/versions/node/v12.18.0/bin/node ./server.js

I have the same issue on Linux Ubuntu 20.04, I'll share that logs too.
Thanks!

vscode-debugadapter-0.json.gz

@SergioEanX
Copy link

This is my trace logs from an Opensuse Tumbleweed:
vscode-debugadapter-1.json.gz

Here still the same issue.

@GitMonkey007
Copy link

I have the same issue, but with Angular, when running in a devcontainer. I believe this worked in 1.48.

I have uploaded a complete example, just need to do an "npm install", and build the angular app. I've also attached the json.gz after running with "trace: verbose".

Nothing exciting in the project except the launch/debug settings, if you open within a container (Remote Containers: Reopen in Container), select "Run" tab, then select "Launch Angular in Container", then just click "Start Debugging", you should see that a breakpoint set in app.component.ts (line 9, which sets the title) doesn't get hit. Note that the breakpoint does get hit if you open this locally and using the "Launch Angular" run configuration.

vscode-debugadapter-6.json.gz
angular-debuggable-upload.zip

@connor4312
Copy link
Member

connor4312 commented Sep 19, 2020

Curiously after removing VS Code altogether and after that upgrading to the latest version, the described issue seems to have gone.

Yea, in the logs it seems like everything is working.

Still I receive a long string (shown twice) as below when I start the debugger:

This is expected when running console: integratedTerminal

This is my trace logs from an Opensuse Tumbleweed:

It doesn't look like we're getting an attachment at all there. Can you try removing console: integratedTerminal to eliminate some varaibles?

I have the same issue, but with Angular, when running in a devcontainer. I believe this worked in 1.48.

Thanks for the logs and repro! Two things --

  • webRoot is a path, not a glob, so you would want ${workspaceFolder} instead of ${workspaceFolder}/**. It also defaults to your workspaceFolder, so you can just omit it.
  • it looks like some of the config resolution the old debugger does interferes with the new one, so you can set type: pwa-chrome to go to the new debugger. I'll make a change to fix this.

With these two changes your launch config should look like this:

{
  "name": "Launch Angular in container",
  "type": "pwa-chrome",
  "request": "launch",
  "preLaunchTask": "start angular in container",
  "url": "http://localhost:4200/",
  "trace": true
}

@GitMonkey007
Copy link

@connor4312 - Thats fixed me! Thank you very much for solving that!

@jomofrodo
Copy link

Also having problems with hitting break points after an upgrade to 1.49.x. Currently I am on 1.49.1. My launch config looks like this:

           {
            "name": "Launch 3 Chrome",
            "type": "pwa-chrome",
            "request": "launch",
            "url": "http://d.cotat/mm",
            "sourceMaps": true,
            "trace": true
          },

vscode-debugadapter-3.json.gz

@connor4312
Copy link
Member

connor4312 commented Sep 20, 2020

@jomofrodo in the log file you sent, your launch config is different -- you have something like

"sourceMapPathOverrides": {
  "webpack:///./": "${workspaceFolder}/mm/"
}

But your sources are like"webpack:///src/components/MediaWidget.vue" -- without the dot -- so that override does not match them. I recommend adjusting your overrides.

@SergioEanX
Copy link

Same NodeJS/ExpressJS app and same issue for VS Code greater than 1.46. This time on Ubuntu 20.04. Any hope to resolve it? Thanks. Below my trace logs.
vscode-debugadapter-0.json.gz

@connor4312
Copy link
Member

@SergioEanX see my followup to your question here #102493 (comment)

@jomofrodo
Copy link

jomofrodo commented Sep 20, 2020

@connor4312 Got it to work with this launch config:

      {
           "name": "Launch v3 Chrome",
           "type": "pwa-chrome",
           "request": "launch",
           "url": "http://d.cotat/mm",
           "sourceMaps": true,
           "trace": true,
           "sourceMapPathOverrides": {
               "webpack:///*":     "*",                               // Example: "webpack:///project/app.ts" -> "/project/app.ts"
               "webpack:///src/*": "${workspaceFolder}/src/*"         // Example: "webpack:///src/app.js" -> "/Users/me/project/src/app.js"
           }
         },

Thanks for the help.

@SergioEanX
Copy link

SergioEanX commented Sep 21, 2020

New trace logs below (having removed "console": "integratedTerminal")
Following a previous suggestion I realized that by setting

"debug.javascript.usePreview": false

in settings.json, actually resolve the issue.
Thanks again!

@SergioEanX see my followup to your question here #102493 (comment)
vscode-debugadapter-5.json.gz

@hanshamm
Copy link

hanshamm commented Sep 23, 2020

I have the same issue with the latest VSCode (Version: 1.49.1)

            "type": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "localhost:8080",
            "webRoot": "${workspaceFolder}",

It worked before, now it says unbound breakpoint once debugging starts.

I am using one non local javascript module using "unpkg" to import:
import * as EcsyThree from 'https://unpkg.com/ecsy-three?module';

Not sure if this is important to know.

@connor4312
Copy link
Member

@hanshamm please collect trace logs so I can help with your issue!

@SergioEanX do you have any kind of antivirus/firewall running locally? We've seen a few cases presenting the same symptoms that were caused by an AV blocking the program connecting back to VS Code.

@connor4312
Copy link
Member

@hanshamm can you please collect a single isolated log with the issue you're describing so I can efficiently and correctly identify your problem?

@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests