VS Code: “Breakpoint ignored because generated code not found” error

前端 未结 18 2589
无人共我
无人共我 2020-12-13 08:07

I have looked everywhere and I still have issue debugging TypeScript inside VS Code. I have read this thread but still I am not able to hit my breakpoints placed inside a Ty

18条回答
  •  自闭症患者
    2020-12-13 08:36

    None of the other answers worked for me.

    I then realised the program attribute in my launch.json was pointing to the .js file, but my project is a TypeScript project.

    I changed it to point to the TypeScript (.ts) file, and set the outFiles attribute to point to where the compiled code lives:

    {
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${workspaceRoot}/src/server/Server.ts",
        "cwd": "${workspaceRoot}",
        "outFiles": ["${workspaceRoot}/dist/**/*.js"]
    }
    

    This solved the issue for me!

提交回复
热议问题