vscode-js-debug: WSL2 chrome debug with Error running browser: connect ECONNREFUSED 127.0.0.1:53579
Describe the bug WSL2 chrome debug not possible, browser opens for a moment then closes, with messege:
Error running browser: connect ECONNREFUSED 127.0.0.1:53579
To Reproduce Steps to reproduce the behavior:
- On windows 10, install WSL2
- Install VSCODE (insiders or stable)
- Try debug javascript
launch.json:
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "http://localhost:5000",
"trace": true,
"webRoot": "${workspaceFolder}"
},
Log File vscode-debugadapter-00e1f992.json
Vscode -> 1.56.0-insider Javacript Debugger (Nightly) v2021.4.2617
Additional context Curiously installing older versions of the javascript debugger also give the same error, even versions 3 months old Also installing older versions of Debugger for chrome and Remote WSL also fails with the same error
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (2 by maintainers)
The following worked for me. If I open my project using the “Remote - WSL” VS Code extension, e.g. by typing code /my/folder in Linux, I get this issue. However, if I open the folder as a “normal Windows folder” rather than a WSL folder by browsing to \\wsl$ in Explorer I can debug OK.
getting this error on vs code
version 1.66.2
I just changed the type to “edge” and it works. Maybe changing it to just “chrome” might work
As far as i can tell it’s fixed and working as intended, @connor4312 great job, thank you!
Verifier: easiest way is to:
Debug: Open Link
commandI could not reproduce this before, but for some reason tonight I could. It seems there’s some latency (in WSL?) before the port is available to connect to. We’ll now retry for 5 seconds which seems to fix this issue for me.
This’ll be in the VS Code release next week, and Insiders tomorrow. Please try it out and let me know if you still hit this.
When I click on Run and Debug, I get sent to
file:///root/wsl-projects/project1/index.html
However, I want to go to
file://wsl.localhost/Ubuntu/root/wsl-projects/project1/index.html
If I copy paste in the second to URL, it works fine.
Getting this error on 1.76.1. Workaround is to open from explorer rather than WSL shell but would be nice if it wasn’t broken.
EDIT: Just noticed I left a comment on the same issue in 2021 and still not fixed. 😆
It’s not working for me too but with a twist. If I retry again and again after 10-20 tries it is working and chrome comes up and debugger attached. I change nothing between the tries just closed chrome and stopped debugger and then hit the debug button again. I can quickly see if it is working if the about:blank entry in the url bar is changed to localhost.
Not working for me, still getting ECONNREFUSED debugging browsers in WSL2, and i am trying all the config presented here. Got the java script debbuger (nightly) isntalled