带有 Chrome 调试器扩展的 Visual Studio Code 中的“未验证断点" [英] “Unverified breakpoint” in Visual Studio Code with Chrome Debugger extension

查看:33
本文介绍了带有 Chrome 调试器扩展的 Visual Studio Code 中的“未验证断点"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Chrome Debugger 扩展在 Visual Studio Code 中调试我的 Typescript 代码,但我在断点上收到未验证断点"消息,并且执行不会在我的断点处停止.

I am trying to debug my Typescript code in Visual Studio Code, using the Chrome Debugger extension, but I am getting the "Unverified breakpoint" message on my breakpoint, and execution does not stop on my breakpoint.

这是我的launch.json文件:

Here is my launch.json file:

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

应用版本:

  • Visual Studio 代码:1.25.1
  • 铬:67.0.3396.99

有关如何解决此问题的任何其他建议?

Any other suggestions on how I can solve this issue?

推荐答案

我终于发现问题所在了:

I finally found out whats wrong:

当我阅读${workspaceFolder}"的定义时,它说明了以下内容:

When I read the definition of '${workspaceFolder}', it states the following:

VS Code中打开的文件夹路径

the path of the folder opened in VS Code

我的错误:

我在 Windows 中到我的项目的路径如下:C:UsersmyusernameDocumentsVSCodeSourceProjectName

My path in Windows to my project was as follow: C:UsersmyusernameDocumentsVSCodeSourceProjectName

通过 Visual Studio Code,我打开了 Source 文件夹,并且总是需要在 Integrated Terminal 中将目录 (cd ProjectName) 命令更改为ProjectName".这会导致在 Source 文件夹中创建 .vscode 文件夹和 launch.json 文件,而不是在 ProjectName 文件夹中.

Through Visual Studio Code, I had the Source folder open, and always needed to do a change directory (cd ProjectName) command in Integrated Terminal to 'ProjectName'. This lead to the .vscode folder and launch.json file being created in the Source folder, and not the ProjectName folder.

上述错误导致 ${workspaceFolder} 指向 Source 文件夹,其中没有 Angular 组件,而不是指向 ProjectName 文件夹.

The above mistake lead to the fact that the ${workspaceFolder} was pointing to the Source folder, where no Angular components was, instead of pointing to the ProjectName folder.

修复:

在 Visual Studio Code 中,打开文件夹:C:UsersmyusernameDocumentsVSCodeSourceProjectName 并在该目录中设置我的 launch.json.

In Visual Studio Code, open folder: C:UsersmyusernameDocumentsVSCodeSourceProjectName and setup my launch.json in that directory.

这篇关于带有 Chrome 调试器扩展的 Visual Studio Code 中的“未验证断点"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆