mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.46k stars 194 forks source link

Error while using dap with node.js #1109

Closed dir1337 closed 10 months ago

dir1337 commented 10 months ago

Debug adapter definition and debug configuration

local dap = require("dap")

dap.adapters["pwa-node"] = {
  type = "server",
  host = "127.0.0.1",
  port = 9229,
  executable = {
    command = "js-debug-adapter",
  }
}

for _, language in ipairs { "typescript", "javascript" } do
  dap.configurations[language] = {
    {
      type = "pwa-node",
      request = "launch",
      name = "Launch file",
      program = "${file}",
      cwd = "${workspaceFolder}",
      runtimeExecutable = "/usr/bin/node",
    },
  }
end

Debug adapter version

v1.85.0

Steps to Reproduce

  1. setup nvim-dap
  2. setup nvim-dap-ui
  3. make the same config

Expected Result

The debugger should open.

Actual Result

Error: Couldn't connect to 127.0.0.1:9229: ECONNREFUSED

mfussenegger commented 10 months ago

Sounds like either js-debug-adapter isn't listening on 9229 or it takes too long to start up, in which case you could increase the retries via the max_retries option.

In any case, I don't see how this is a bug and this isn't a support forum to troubleshoot configuration problems.