Visual Studio代码调试不使用Angular 6 CLI
您好,我试图在visual studio代码中调试应用程序,但无法调试,它会显示错误消息“不支持配置的调试类型'chrome' 下面是launch.json文件代码Visual Studio代码调试不使用Angular 6 CLI,angular,debugging,visual-studio-code,angular6,Angular,Debugging,Visual Studio Code,Angular6,您好,我试图在visual studio代码中调试应用程序,但无法调试,它会显示错误消息“不支持配置的调试类型'chrome' 下面是launch.json文件代码 { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.co
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 4200,
"webRoot": "${workspaceFolder}"
}
]
}
你应该遵循这个,做得很好
另外,不要忘记启动debbuger时需要启动应用程序。您需要在现有配置中添加下面的“webRoot”:
"sourceMapPathOverrides": {
"/./*": "${webRoot}/*",
"/src/*": "${webRoot}/*",
"/*": "*",
"/./~/*": "${webRoot}/node_modules/*",
}
任何想要快速解决问题的人都可以尝试以下方法: 确保Launch.json设置中的端口号与“ng serve”命令后的端口号相同。通常是“4200”,并尝试在launch.json中包含启动和附加设置 一旦“ng serve”完成并且angular server开始侦听,请尝试单击“开始调试” 然后调试器将在4200上启动一个chrome实例,然后您可以看到断点将被绑定
不要通过键入链接手动启动它(http://localhost:4200/)在浏览器中是否安装了chrome扩展?是你想做什么让它工作。