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

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

问题描述

我正在尝试使用Chrome调试器扩展程序在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

  • Chrome: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:\Users\myusername\Documents\VSCode\Source\ProjectName

My path in Windows to my project was as follow: C:\Users\myusername\Documents\VSCode\Source\ProjectName

通过Visual Studio Code,我打开了 Source 文件夹,并且总是需要执行更改目录(cd ProjectName) 集成终端中的 ProjectName命令。这导致在 Source 文件夹而不是<$ c中创建 .vscode文件夹和launch.json文件。 c $ c> 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:\Users\myusername \文档\VSCode\源\ProjectName ,然后在该目录中设置我的 launch.json

In Visual Studio Code, open folder: C:\Users\myusername\Documents\VSCode\Source\ProjectName and setup my launch.json in that directory.

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

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