Vscode-js-debug: Local debugging javascript doesn't work in vscode

Created on 20 Jul 2020  路  21Comments  路  Source: microsoft/vscode-js-debug

Describe the bug
Not able to debug or run javascript locally within vscode.

Steps to reproduce the behavior:

  1. create a js file, with some code like console.log
  2. click run and debug, or setting up the most basic Launch.js
  3. It doesn't run the js file. Or if you have break points, it'll never hit.

In console, there's no specific error
Debugger listening on ws://127.0.0.1:49774/9da12940-c5bf-4452-905a-739d52d90700
For help see https://nodejs.org/en/docs/inspector
Process exited with code 0

Note: after I turn off javascript.debug.uesPreview feature, same js file runs file, and debug points are set correctly too.

bug needs more info

Most helpful comment

@mametur you can set ("debug.javascript.usePreview": false), it will work. Think Connor fixed the problem now :)

All 21 comments

Thanks for the issue, can you grab a log file 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 [email protected]

@Caseyyu2 did you solve your problem? I have the same bug but I can't figure it out

Same problem here, and the same "solution" worked ("debug.javascript.usePreview": false)

@connor4312 Here is log file:
vscode-debugadapter-3.json.gz

@stjepannikolic your problem is fixed in the latest version of VS Code -- update to 1.47.2 to get it!

@mametur you can set ("debug.javascript.usePreview": false), it will work. Think Connor fixed the problem now :)

@Caseyyu2 just to confirm -- are you saying that updating solved the problem for you as well?

@connor4312 I tried to update my vscode (1.47.1) but it didn't change anything but when I place ("debug.javascript.usePreview": false) property to in javascript debugging setting.json file then it works

@mametur note that the latest version is 1.47.2, not .1. If you're on Linux, we're currently looking into an issue where this is not yet published (https://github.com/microsoft/vscode/issues/102839). If it doesn't work after updating to 1.47.2, please collect a trace log using the instructions above.

@connor4312 yeah, I have been trying to get the last version of it but says this is the last version. (yeah I am on Linux). I saw issue now thanks :pray:

@connor4312 I'm on 1.47.2, but I'm still having that issue

vscode-debugadapter-0.json.gz
Here's the log file

@Caseyyu2 for me it works now:)

Thanks @Caseyyu2! I'm not totally sure what the root cause is yet and running your specific Node version locally didn't show significant issues. Can you try the following:

  1. Set "console": "integratedTerminal", in your launch.json
  2. Install this version of the extension via the "Install from VSIX" command https://memes.peet.io/img/js-debug-for-643.vsix
  3. Run it and let me know what console output you get

I also suspect that if you update Node to a more recent version (Node 8 is end of life as of April this year) this will be fixed, but am not sure.

I'm hitting the same issue here. Updated to 1.47.2 this morning (running on Win10), and I'm basically unable to use the new debugger...

Adding "debug.javascript.usePreview": false to my settings.json allowed me to revert to the old debugger, so that's working for now. Still no luck with the new debugger though.

Here's my log file, if it helps at all:
vscode-debugadapter-0.json.gz

Thanks!

@djaskolka I believe you're hitting https://github.com/microsoft/vscode-js-debug/issues/645#issuecomment-662579968

@connor4312 Ah, indeed I am! Thanks!

Closing due to lack of info.

@Caseyyu2 since you reported I got another report that looked similar and opened https://github.com/nodejs/node/issues/34522. The reporter in that case said that just reinstalling Node made it work for them. You can try the same thing if you'd like; since you're on the end-of-life Node 8, it may also be a good opportunity to update to a more recent version 馃檪

@stjepannikolic your problem is fixed in the latest version of VS Code -- update to 1.47.2 to get it!

I was still getting this issue in 1.54.1 (Windows). Setting "debug.javascript.usePreview": false fixed the problem (skipFiles being completely ignored) for me. Additionally, setting trace in launch.json did not log anything at all. Setting trace in settings.json was an invalid option and also did not log anything at all.

If only I could select the text on the VSCode->About dialog.

Getting this in 1.55.1 (Windows) debugging on WSL2. Setting "debug.javascript.usePreview": false fixed the issue.

@zachradtka please create a new issue using the template. The usePreview option is disappearing soon.

After leaving my first comment I read the referenced node bug (https://github.com/nodejs/node/issues/34522). I was using node 8. After updating the the most recent version (15.14.0) and restarting VSCode, everything works.

For those in the future that have this issue, try updating node first 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

isidorn picture isidorn  路  6Comments

roblourens picture roblourens  路  5Comments

baptoutiego picture baptoutiego  路  3Comments

connor4312 picture connor4312  路  4Comments

geirsagberg picture geirsagberg  路  5Comments