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:
Error running browser: connect ECONNREFUSED 127.0.0.1:41613Log File
vscode-debugadapter-57b9e7fa.json.gz
VS Code Version: 1.53.2
Additional context
Add any other context about the problem here.
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?

"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
```{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost",
"webRoot": "${workspaceFolder}",
"trace": true,
}
]
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.
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:53876I just ran out of things to try, and i need to work :(