我正在尝试使用 VScode 调试我的 Angular 应用程序。如果我启动我的计算机,运行应用程序并立即启动我的调试器,它工作正常。
在我工作了一段时间后,问题就开始了,打开程序并在 chrome 中打开不同的选项卡等。
如果我尝试重复启动调试器的过程,则会引发错误。
无法连接到运行时进程,10000 毫秒后超时 - (原因:找不到匹配的有效目标:about:blank。可用页面:[“ http://localhost:9877/?id%3D580327 ”])。
无论我是否重新启动 VScode,关闭所有浏览器或其他任何东西,都没有任何效果。我基本上必须重新启动我的电脑才能让它再次工作(不酷)。
这是我故意使用端口 4202 的“launch.json”
{ // For this config to work, the app must already be running on 4202
// This simply opens the app chome with the debugger on this port
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4202/",
"webRoot": "${workspaceFolder}"
}