如何用nvim-dap调试远程TypeScript Vitest单元测试?
远程调试Vite TypeScript单元测试时nvim-dap断点失效问题
我在域名remoteserver的远程服务器上运行Vite TypeScript单元测试,执行命令:
node --inspect-brk=0.0.0.0 ./node_modules/vitest/vitest.mjs run --threads false src/backend/api.spec.ts
当使用nvim-dap附加调试时,出现报错:
Breakpoint ignored because generated code not found (source map problem?).
我的nvim-dap配置如下:
适配器配置:
dap.adapters = { node2 = { type = 'executable', command = 'node', args = { '/var/git/github.com/microsoft/vscode-node-debug2/out/src/nodeDebug.js' } } }
TypeScript调试配置:
dap.configurations.typescript = { { type = "node2", address = "remoteserver", port = 9229, request = "attach", sourceMaps = true } }
更新:VS Code可以正常触发调试断点,但nvim-dap即便设置了sourceMaps = true,还是无法正确识别源映射导致断点失效。
内容的提问来源于stack exchange,提问作者Lajos
相关产品推荐
相关产品推荐

