mxsdev / nvim-dap-vscode-js

nvim-dap adapter for vscode-js-debug
276 stars 30 forks source link

pwa-node config for nestjs projects #41

Closed zilverjk closed 1 year ago

zilverjk commented 1 year ago

Hello I would like to know how I can configure correctly the adapter in order to get work the debugger?. This is my current config

{
            type = "pwa-node",
            request = "launch",
            name = "NestJS: Launch",
            -- runtimeExecutable = "nest",
            program = "${workspaceFolder}/src/main.ts",
            cwd = "${workspaceFolder}",
            skipFiles = {
                "<node_internals>/**",
            },
            sourceMaps = true,
            resolveSourceMapLocations = {
                "${workspaceFolder}/**",
                "!**/node_modules/**",
            },
            protocol = "inspector",
            console = "integratedTerminal",
            port = 3000,
            -- args = { "start", "--watch", "--debug" },
            env = {
                NODE_ENV = "dev",
            },
            outFiles = {
                "${workspaceFolder}/dist/main.js",
            },
            sourceMapPathOverrides = {
                ["webpack:///./src/*"] = "${workspaceFolder}/src/*",
                ["webpack:///src/*"] = "${workspaceFolder}/src/*",
                ["webpack:///*"] = "*",
            },
        },

With this config I get an error in the repl following the debug disconnect when Im trying to lunch the debug

Screenshot 2023-04-07 at 8 05 04 PM

And this is my tsconfig.js

image

thanks for the help in advance.

zilverjk commented 1 year ago

Forget the adapter config of the issue, use the default and start the nest app with this command node --inspect ./dist/main.js and the debugger will start