VS Code Unverified Breakpoints

后端 未结 6 715
温柔的废话
温柔的废话 2021-02-12 18:05

I\'m trying to debug a Node/Express TypeScript app in VS Code (v. 1.24.0) and all my breakpoints are greyed out during debugging.

The error is \"Unverified Breakpoint, B

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-12 18:34

    For anyone who runs into this error, I was able to find a solution. The issue was the way I was launching the Node process, not the mapping of the source maps (which produces a different error).

    To attach to the process, I launched it from the VS Code terminal like this:

    node --inspect dist/server.js
    

    launch.json:

    {
                "type": "node",
                "request": "attach",
                "name": "Attach by Process ID",
                "processId": "${command:PickProcess}",
                "protocol": "inspector",
                "address": "localhost",
                "port": 8080,
                "restart": true,
                "preLaunchTask": "npm: build",
                "sourceMaps": true,
                "outFiles" : [ "${workspaceRoot}/dist/**/*.js" ]
            },
    

提交回复
热议问题