-
Notifications
You must be signed in to change notification settings - Fork 35
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
JS debugger not working #63
Comments
Here's how I made it work, although I should note I didn't use this extension. local dap = require('dap')
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}", --let both ports be the same for now...
executable = {
command = "node",
-- -- 💀 Make sure to update this path to point to your installation
args = { vim.fn.stdpath('data') .. "/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js", "${port}" },
-- command = "js-debug-adapter",
-- args = { "${port}" },
},
}
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = 'pwa-node',
request = 'launch',
name = 'Launch Current File (pwa-node)',
cwd = "${workspaceFolder}", -- vim.fn.getcwd(),
args = { '${file}' },
sourceMaps = true,
protocol = 'inspector',
},
{
type = 'pwa-node',
request = 'launch',
name = 'Launch Current File (Typescript)',
cwd = "${workspaceFolder}",
runtimeArgs = { '--loader=ts-node/esm' },
program = "${file}",
runtimeExecutable = 'node',
-- args = { '${file}' },
sourceMaps = true,
protocol = 'inspector',
outFiles = { "${workspaceFolder}/**/**/*", "!**/node_modules/**" },
skipFiles = { '<node_internals>/**', 'node_modules/**' },
resolveSourceMapLocations = {
"${workspaceFolder}/**",
"!**/node_modules/**",
},
},
}
end |
When I try this config, I get this error when I launch the debugger, even though ts-node is installed (via Homebrew on MacOS). It works if I install ts-node as a project dependency. Do you know if there is a way to configure the debugger to use the global ts-node?
|
For this config you need to install the ts-node package with npm/yarn/etc. |
I am trying to debug my typescript file. And using lunar-vim btw. and getting the following error:
Error
[dap-js] Error trying to launch js-debugger: EONENT: No such file or directory.
My dap configuration
The text was updated successfully, but these errors were encountered: