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

前端 未结 18 2641
无人共我
无人共我 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:52

    Facing the same issue and solved it by correcting "webRoot" config in launch.json. Here's my workspace's explorer view.

    Since the compiling result main.js and main.js.map are in "./project/www/build" directory, I change the "webRoot" entry to "${workspaceRoot}/project/www/build" from "${workspaceRoot}", and it worked!

    The launch.json file is as follow:

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Launch Chrome against localhost",
                "type": "chrome",
                "request": "launch",
                "url": "http://localhost:8100",
                "sourceMaps": true,
                "webRoot": "${workspaceRoot}/project/www/build"
            },
            {
                "name": "Attach to Chrome",
                "type": "chrome",
                "request": "attach",
                "port": 9222,
                "url": "http://localhost:8100",
                "sourceMaps": true,
                "webRoot": "${workspaceRoot}/project/www/build"
            }
        ]
    }
    

提交回复
热议问题