Skip to content

DAP quits without stopping on breakpoint when running on typescript code #26

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

Open
dlukegordon opened this issue Feb 3, 2023 · 0 comments

Comments

@dlukegordon
Copy link

Hello, I am trying to debug a typescript file, test.ts:

const x = 1;
const y = 2;
const z: number = 3;
console.log(x, y, z);
console.log('Test');

When I try to run the debugger on the above file, with a breakpoint on the last line, it starts and then quits immediately, without any sort of error. I have tried looking in dap-vscode-js logs, and dap logs, but can't find anything.

Interestingly, when I run the below code, almost the same as above except without type information, it works fine and stops on the breakpoint:

const x = 1;
const y = 2;
const z = 3;
console.log(x, y, z);
console.log('Test');

Here are my relevant neovim config lines:

require("dap-vscode-js").setup({
  adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, -- which adapters to register in nvim-dap
  log_file_path = "/tmp/dap_vscode_js.log",
  log_file_level = vim.log.levels.DEBUG,
  log_console_level = vim.log.levels.DEBUG,
})

...

use { "mxsdev/nvim-dap-vscode-js", requires = {"mfussenegger/nvim-dap"} }
use {
  "microsoft/vscode-js-debug",
  opt = true,
  run = "npm install --legacy-peer-deps && npm run compile",
}

...

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

Can someone please help?

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