vscode-firefox-debug
vscode-firefox-debug copied to clipboard
Connection refused while using Nvim DAP
Hey! I'm trying to debug in firefox, but every time I try running I receive this error: Error on launch: connect ECONNREFUSED ::1:6000
I verified the debug server is running on port 6000 by running lsof -i 6000
and my configuration looks like this:
dap.adapters.firefox = {
type = "executable",
command = "node",
args = { os.getenv("HOME") .. "/apps/vscode-firefox-debug/dist/adapter.bundle.js" },
}
Then the launch configuration:
{
name = "Debug with Firefox",
type = "firefox",
request = "launch",
reAttach = true,
url = "http://localhost:3000",
webRoot = "${workspaceFolder}",
firefoxExecutable = "/usr/bin/firefox",
},
I have all the necessary about:config
variables set, but the connection is always refused, is there something I have to change?
After tinkering around a bit, I found that after launching, I can connect to the server with the attach configuration:
{
name = "Debug with Firefox - Attach",
type = "firefox",
request = "attach",
reAttach = true,
host = "127.0.0.1",
url = "http://localhost:3000",
webRoot = "${workspaceFolder}",
},
I can access the repl, but setting breakpoints doesn't do anything (it does display an "R" in the column as opposed to a B in other debuggers).
I've had the same experience as you, have you come around this issue? @joshpetit
I've had the same experience as you, have you come around this issue? @joshpetit
Sadly no, I couldn't find a work around, but the debugger in the Firefox console works so you can step through that, but not in your preferred editor.
@joshpetit @andresestrella I had the same problem. Try an older version of node. lts/gallium
(v16.19.1) worked for me, while stable
(v19.0.0) did not.
I think the issue is newer node versions default requests to IPv6 (::1 is the IPv6 loopback), but Firefox opens the port 6000 on IPv4.
After tinkering around a bit, I found that after launching, I can connect to the server with the attach configuration:
{ name = "Debug with Firefox - Attach", type = "firefox", request = "attach", reAttach = true, host = "127.0.0.1", url = "http://localhost:3000", webRoot = "${workspaceFolder}", },
I can access the repl, but setting breakpoints doesn't do anything (it does display an "R" in the column as opposed to a B in other debuggers).
With firefox-developer-edition -start-debugger-server
and this configuration I'm able to run the debugger but as you said breakpoints doesn't do anything.
Is there a fix for this? I started using VS code yesterday and immediately ran into this problem.
@SanderBouwhuis
Is there a fix for this? I started using VS code yesterday and immediately ran into this problem.
fix https://github.com/firefox-devtools/vscode-firefox-debug/issues/306#issuecomment-1490922655 PR https://github.com/firefox-devtools/vscode-firefox-debug/pull/329