Vscode-js-debug: Error running browser: connect ECONNREFUSED 127.0.0.1:41613

Created on 26 Feb 2021  路  9Comments  路  Source: microsoft/vscode-js-debug

Describe the bug
In wsl 2 I am unable to connect to my browser.
When installing with a fresh and fresh launch.json system it works fine but after "userDataDir" was set it boots up once then after reboot I cant connect

To Reproduce
Steps to reproduce the behavior:

  • Freshly installed vs-code-insiders 1.54 (Same bug with stable version)
  • Install the WSL2 extensions for vs-code when prompted
  • Create a default launch "pwa-chrome". Make sure you running in vs-code remote WSL:ubuntu
  • Testing it works fine
  • set the "userDataDir" so that you can install vue-devtools and have it stick between reboots.
  • Reboot
    -Error Error running browser: connect ECONNREFUSED 127.0.0.1:41613
  • Removing userDataDir does not fix the bug
  • Restarting vs-code or creating a new launch config doesnt fix it

Log File
vscode-debugadapter-57b9e7fa.json.gz

VS Code Version: 1.53.2

Additional context
Add any other context about the problem here.

bug needs more info

Most helpful comment

I got bitten by this, @connor4312 could you please re-open?
Same issue with the exception that i did not fiddle with userDataDir.
my config:
{ "name": "Launch Chrome", "request": "launch", "type": "pwa-chrome", "url": "http://localhost:8080", "webRoot": "${workspaceFolder}" },
i tried @mellester fix but it doesn't work for me. re-installing vscode, wsl2, using insiders, using stable, nothing works
Chrome opens for 3 seconds, then it closes on me, and i get the:
Error running browser: connect ECONNREFUSED 127.0.0.1:53876
I just ran out of things to try, and i need to work :(

All 9 comments

In the log you added it looks like you're trying to attach to a browser. In attach mode, the browser isn't launched by VS Code and the userDataDir is not controlled by the debugger. In this case, I would expected to see a connection refused if the browser isn't launched with a correct set of arguments. Can you clarify what you're doing?

image
"type": "pwa-chrome", "request": "launch", "name": "Launch Chrome against localhost", "url": "http://localhost", "webRoot": "${workspaceFolder}", "userDataDir": "/home/melle/example-app/.vscode/chrome",
My thought process was trying to make extension like vue-devtools stick between sessions. But not use my real windows profile
Because its Sunday I decided to use my home-pc to try and recreate the bug on there but am unable to recreate the behavior.
I will try an get the more information about with version of the extension I am running during the week

{

    "version": "0.2.0",
    "configurations": [
        {
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost",
            "webRoot": "${workspaceFolder}",
            "userDataDir": "profile",
            "trace": true,
        }
    ]
}

Version: 1.54.0-insider
debugger for chrome v4.12.12 msjsdiag.debugger-for-chrome
vscode-debugadapter-34e09aac.json.gz

Removing userdatdir

```{

"version": "0.2.0",
"configurations": [
    {
        "type": "pwa-chrome",
        "request": "launch",
        "name": "Launch Chrome against localhost",
        "url": "http://localhost",
        "webRoot": "${workspaceFolder}",
        "trace": true,
    }
]

}
```
vscode-debugadapter-0b2c9413.json.gz

Working logs
vscode-debugadapter-ca2aee11.json.gz

```Bash
cd ~
rm -r .vscode-server
````

I have found a solution to my problem.
Removing the vscode from my wsl2 instance then rebooting said instance allows it to work again

Not sure if I should close the issue @connor4312 ?

Unless there's a repro I would close it. The error message is from the Windows side of things being unable to connect back to WSL. I would guess this is some network issue or misconfiguration with WSL2, that maybe a reboot or update associated with a reboot fixed.

I got bitten by this, @connor4312 could you please re-open?
Same issue with the exception that i did not fiddle with userDataDir.
my config:
{ "name": "Launch Chrome", "request": "launch", "type": "pwa-chrome", "url": "http://localhost:8080", "webRoot": "${workspaceFolder}" },
i tried @mellester fix but it doesn't work for me. re-installing vscode, wsl2, using insiders, using stable, nothing works
Chrome opens for 3 seconds, then it closes on me, and i get the:
Error running browser: connect ECONNREFUSED 127.0.0.1:53876
I just ran out of things to try, and i need to work :(

Same issue here. Also didn't fiddle with userDataDir. It happened for me right after updating VScode to v1.55.0

{
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceFolder}",
      "sourceMaps": true,
      "sourceMapPathOverrides": {
        "webpack://mutation-testing-elements/*": "${webRoot}/*"
      }
    }

Thanks for the pings, merging into https://github.com/microsoft/vscode/issues/120227. Please follow that issue for updates.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

byroniac picture byroniac  路  6Comments

isidorn picture isidorn  路  6Comments

eamodio picture eamodio  路  5Comments

thomasrea0113 picture thomasrea0113  路  6Comments

roblourens picture roblourens  路  7Comments