【问题标题】:`vscode debug angular can't hit breakpoint: breakpoint set but not yet bound`vscode debug angular can't hit breakpoint:断点已设置但尚未绑定
【发布时间】:2020-05-18 11:08:29
【问题描述】:

我参考了这篇文章中的方法:How To Debug An Angular Application In Chrome ,用Debugger for Chrome在vscode中调试了angular app,但无法下断点:breakpoint set but not yet bound

vscode 版本:1.41.0
角度版本:8.2.14
Debug for chrome 版本:4.12.6

我的项目结构是:

|--.vscode
|      |--lanuch.json
|--dist
|    |--ng-app
|          |--index.html
|          |--...
|          
|--projects
|     |--ng-app
|     |    |--e2e
|     |    |--src
|     |
|     |--ng-demo
|          |--e2e
|          |--src 
|     
|--angular.json
|--tsconfig.json
|--package.json

我要调试ng-app,launch.json文件内容:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:4200",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

我不知道哪里出了问题,以及如何解决它。我在谷歌上搜索,但没有得到合适的答案。

谢谢!

【问题讨论】:

    标签: visual-studio-code angular8


    【解决方案1】:

    是webRoot,需要指向应用:

    "webRoot": "${workspaceFolder}/myapp/src",
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-18
      • 1970-01-01
      • 2018-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-09
      相关资源
      最近更新 更多