Open frdrkolsson opened 1 year ago
I'm also having this issue
Had the same issue.
The problem is that the launch configuration is incorrectly typed. I think we all copied it from some blog post or something, though I am not sure which one.
In any case, the bad configuration is this
dap.configurations[language] = {
{
{
type = "pwa-node",
request = "launch",
name = "Launch Test Program (pwa-node with vitest)",
cwd = "${workspaceFolder}",
program = "${workspaceFolder}/node_modules/vitest/vitest.mjs",
args = { "--threads", "false", },
autoAttachChildProcesses = false,
trace = true,
console = "integratedTerminal",
sourceMaps = true,
smartStep = true,
},
}
}
Thats' one curly too much :-)
The correct one is this
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch Test Program (pwa-node with vitest)",
cwd = "${workspaceFolder}",
program = "${workspaceFolder}/node_modules/vitest/vitest.mjs",
args = { "--threads", "false", },
autoAttachChildProcesses = false,
trace = true,
console = "integratedTerminal",
sourceMaps = true,
smartStep = true,
},
}
What works for me is:
for _, js_filetype in ipairs(js_based_filetypes) do
dap.configurations[js_filetype] = {
-- Debug single Vitest
{
type = "pwa-node",
request = "launch",
name = "Vitest File (pwa-node)",
autoAttachChildProcesses = true,
runtimeExecutable = "node",
runtimeArgs = {
"${workspaceFolder}/node_modules/vitest/vitest.mjs",
"--inspect-brk",
"${file}",
"--poolOptions.threads.singleThread",
"true",
},
rootPath = "${workspaceFolder}",
cwd = "${workspaceFolder}",
console = "integratedTerminal",
skipFiles = { "<node_internals>/**", "**/node_modules/**" },
}
}
Hi,
Just set this up and have been debugging it for a couple of hours now to no avail.
Every time I run
:lua require('dap').continue
with the config down below, I get the message in the title.The configuration seems to load, but the adapter does not seem to be registered.
The following is my config. Tried with a different couple of setups just to get this started, but none seems to cooperate. Have tried on both
.js
and.tsx
files.Does anyone see something out of place, or know why none of the adapters from this plugin seems to be setup? My neovim config is available here if anyone is interested into looking deeper into the problem.