Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused while using Nvim DAP #306

Open
joshpetit opened this issue Nov 15, 2022 · 7 comments · May be fixed by #329
Open

Connection refused while using Nvim DAP #306

joshpetit opened this issue Nov 15, 2022 · 7 comments · May be fixed by #329

Comments

@joshpetit
Copy link

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?

@joshpetit
Copy link
Author

joshpetit commented Nov 16, 2022

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).

@andresestrella
Copy link

I've had the same experience as you, have you come around this issue? @joshpetit

@joshpetit
Copy link
Author

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.

@sorashi
Copy link
Contributor

sorashi commented Mar 30, 2023

@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.

@sorashi sorashi linked a pull request Mar 30, 2023 that will close this issue
@hartontw
Copy link

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.

@SanderBouwhuis
Copy link

Is there a fix for this? I started using VS code yesterday and immediately ran into this problem.

@sorashi
Copy link
Contributor

sorashi commented Sep 20, 2023

@SanderBouwhuis

Is there a fix for this? I started using VS code yesterday and immediately ran into this problem.

fix #306 (comment)
PR #329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants