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

Server not closing after terminating #61

Open
ScopeSV opened this issue Oct 7, 2023 · 0 comments
Open

Server not closing after terminating #61

ScopeSV opened this issue Oct 7, 2023 · 0 comments

Comments

@ScopeSV
Copy link

ScopeSV commented Oct 7, 2023

Hi.
I've finally gotten debugging working (well, almost).
It works the first time, however when I debug a node server and terminate, it doesn't close the server.
Im using LazyVim with nvim dap extras.
I use dap-vscode-js for the setups, which is basically taken straight out of the docs:

require("dap-vscode-js").setup({
  adapters = { "pwa-node" },
})

for _, language in ipairs({ "typescript", "javascript" }) do
  require("dap").configurations[language] = {
    {
      type = "pwa-node",
      request = "launch",
      name = "ts-node",
      program = "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
      sourceMaps = true,
      args = { "${workspaceFolder}/src/index.ts" },
      cwd = vim.fn.getcwd(),
      env = {
        NODE_ENV = "dev",
      },
    },
    {
      type = "pwa-node",
      request = "launch",
      name = "ts-node-dev",
      program = "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
      sourceMaps = true,
      args = { "${workspaceFolder}/src/index.ts" },
      cwd = vim.fn.getcwd(),
    },
    {
      type = "pwa-node",
      request = "launch",
      name = "PBL",
      program = "${file}",
      cwd = "${workspaceFolder}",
    },
  }
end

So at first run, the debugger starts up the server. When I terminate everything looks fine.
When I start up again, the port is in use.
When I kill the port and start the debugger again, it works until next time I terminate.

The same launch scripts works perfectly in vscode.

Any suggestions?
Im happy to give more information about my setup if needed, but as I have no idea what's going on I don't know what to provide :D

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

No branches or pull requests

1 participant