Closed igorlfs closed 1 year ago
I have the same issue. Did you fixed @igorlfs?
I don't know exactly why, but it's working now. Can you try the following config?
for _, language in ipairs({ "typescript", "javascript" }) do
require"dap".configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
}
end
It should be enough to debug JS. If you're using TS, however, it's more tricky, but I got this working:
{
type = "pwa-node",
request = "launch",
name = "Launch File (ts-node)",
cwd = vim.fn.getcwd(),
runtimeArgs = { "--loader", "ts-node/esm" },
runtimeExecutable = "node",
args = { "${file}" },
sourceMaps = true,
protocol = "inspector",
skipFiles = { "<node_internals>/**", "node_modules/**" },
console = "integratedTerminal",
resolveSourceMapLocations = {
"${workspaceFolder}/**",
"!**/node_modules/**",
},
},
If you're still getting the nil
adapter with these settings, you can try moving your dap-vscode-js
' setup to right above where you're setting the dap config, as there might be some lazy loading or some packer magic loading yout dap config before dap-vscode-js
is set.
@igorlfs thanks! I'm not sure what was fixed as well, lol, but I guess it happened after I installed vscode-js-debug
using Mason. It's called js-debug-adpter there
I think the issue was the launch config. It had one "curly" too many
You had
dap.configurations.javascript = {
{
{
type = "pwa-node",
request = "launch",
name = "Launch Current File (pwa-node)",
cwd = vim.fn.getcwd(),
args = { "${file}" },
sourceMaps = true,
protocol = "inspector",
},
},
}
where it should have been
dap.configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch Current File (pwa-node)",
cwd = vim.fn.getcwd(),
args = { "${file}" },
sourceMaps = true,
protocol = "inspector",
},
}
Hello,
I'm trying to use this plugin, but I can't start a debugging session as I get the error in the title. Here's my config:
Am I missing something?