Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode debugger sudden ECONNREFUSED error, cannot connect debugger to Firefox

Debugging with Firefox in VS Code suddenly stopped working on Windows, launching or attaching the debugger always results in error message connect ECONNREFUSED ::1:6000.

Tried deleting all VSCode related configuration and cache files and re-install latest VSCode in user mode, installed latest Firefox Developer Edition and tried debugging with default profile and non-persistent profile to see if the problem lies elsewhere.

Tried different debugger launch configurations.

None of this had any effect and problem still persists.

like image 835
NoLifeDeveloper Avatar asked Apr 08 '26 01:04

NoLifeDeveloper


2 Answers

UPDATE


You might not need to setup port proxy with the command from original solution if you use this setting in your attach configuration as mentioned by some people:

"host": "127.0.0.1"

Also breakpoints don't work for some reason.

Issue seems related to VSCode update 1.82.

Original solution


Resolved on my own by redirecting port 6000 from IPv6 loopback to IPv4 loopback.

For microsoft windows:

Open windows terminal or command line as administrator and type command

netsh interface portproxy add v6tov4 listenaddress=::1 listenport=6000 connectaddress=127.0.0.1 connectport=6000

If you use different port for debugging don't forget to substitute it in the command.

I found out you have to start Firefox with argument -start-debugger-server 6000 and use attach launch configuration like below in VS Code in order for it to work correctly if debugger stops launching after setting up proxy...

{
    "name": "Attach Firefox",
    "type": "firefox",
    "request": "attach",
    "webRoot": "${workspaceFolder}",
}
like image 100
NoLifeDeveloper Avatar answered Apr 10 '26 17:04

NoLifeDeveloper


This is a bug and it is fixed in version 2.9.10.

Commit: https://github.com/firefox-devtools/vscode-firefox-debug/commit/c0a391de7b1a4b2468ada28e67fb4ad54d0dc671

Pull-Request: https://github.com/firefox-devtools/vscode-firefox-debug/pull/342/files

like image 43
BuZZ-dEE Avatar answered Apr 10 '26 17:04

BuZZ-dEE