-
Notifications
You must be signed in to change notification settings - Fork 30
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
Couldn't connect to localhost:${port}: ECONNREFUSED #46
Comments
same issue here. Did you find the solution? |
@anajuliabit Not yet 😕 |
I was getting the same error when using Mason to install the dap. I got it to work using my plugin manager (lazy.nvim) instead. Also make sure not to set up the adapter manually ( {
"microsoft/vscode-js-debug",
build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
},
{
"mxsdev/nvim-dap-vscode-js",
opts = {
debugger_path = vim.fn.stdpath "data" .. "/lazy/vscode-js-debug",
adapters = { "pwa-node", "pwa-chrome" },
},
} |
I was having the same issue, and found this js-debug issue. When i removed the ::1 entry in my /etc/hosts file, it all started working. dap.adapters['pwa-node'] = {
type = 'server',
host = '127.0.0.1',
port = '${port}',
executable = {
command = 'js-debug-adapter',
args = { '${port}' },
}
} and it's still working. |
I was facing the same issue. For me the issue was the node version. I was using node 14 which does not support the Nullish coalescing assignment operator |
I just had the same problem using a lazyvim setup. I did the same as @benelan but got this error:
It seemed like lazyvim wasn't installing vscode-js-debug properly, so I had to do it manually:
Then move the After that it started working again. |
@samcurteis Did you try LazyVim's typescript extras? If that doesn't work maybe you could create a PR or log an issue to swap out LazyVim's implementation for this one. |
hi i ran into this issue was it ever solved |
Just use the dap debug server directly without this plugin. More context: Make sure to always install latest version of vscode-js-debug. Right now that is 1.86.1 and that version is working fine for me even on Nextjs14 (server side and client side) projects with typescript and app router. Don't use oudated guides. vscode-js-debug changes a lot. Don't put configurations like "resolveSourceMapLocations" if you dont understand them. Also vscode-js-debug already provides good defaults. This stuff is hard, sadly. |
hi this came in useful ty you for ur quick reply |
This saved my bacon. Thank you 🙂 For those of you using LazyVim with the return {
"mfussenegger/nvim-dap",
opts = function()
local dap = require("dap")
dap.adapters["pwa-node"].host = "127.0.0.1"
end,
} This will leave all the config from the Lazy Extras intact and just override the specified hostname. PS - Not sure if this is helpful to anyone or not but this issue existed on an M3 Macbook Pro but did not exist on my home PC in WSL. Also, commenting out |
I can't get this plugin to work. After calling
require('dap').continue()
I get the errorCouldn't connect to localhost:${port}: ECONNREFUSED
. Below is the minimal config that I'm using:Click to expand
Here's the TL;DR of the config, which is based on the installation instructions and this thread:
You should be able to download and launch the config above with
nvim -u /path/to/file/above
.Steps to reproduce:
nvim -u /path/to/file/above test.ts
<space>dc
(to start debugging)Couldn't connect to localhost:${port}: ECONNREFUSED
appearsThe text was updated successfully, but these errors were encountered: