0

我正在使用带有Visual Studio代码的Debugger for Chrome插件。无法使用Visual Studio代码和Chrome调试器扩展来调试AngularJS应用程序

1)当我尝试在Visual Studio代码中调试器launch时,出现此错误 - Failed to load resource: net::ERR_CONNECTION_REFUSED

2)当我尝试attach调试器时,出现此错误 - Failed to load resource: the server responded with a status of 404 (Not Found)

我的最终目标是能够调试一个纯粹的AngularJS Web应用程序。

launch.json

{ 
    "version": "0.2.0", 
    "configurations": [ 
     { 
      "name": "Launch Chrome against localhost, with sourcemaps", 
      "type": "chrome", 
      "request": "launch", 
      "url": "http://localhost:8080", 
      "runtimeArgs": [ 
      "--new-window", //Open in new window 
      "--remote-debugging-port=9222" //Open in port 9222 (standard chrome debug port) 
     ], 
      "webRoot": "${workspaceRoot}/app/" 
     }, 
     { 
      "name": "Attach to Chrome, with sourcemaps", 
      "type": "chrome", 
      "request": "attach", 
      "port": 9222, 
      "sourceMaps": true, 
      "webRoot": "${workspaceRoot}" 
     } 
    ] 
} 

注:我已经确定有镀铬的没有运行实例之前,我开始调试。我正在运行Windows 10

+0

确实http://127.0.0.1:9222/json给你的任何输出? –

+0

它为我提供了我已安装的Chrome扩展的输出。 @RuiSebastião – Doe

回答

0

我遇到了同样的问题:启动vs代码调试器并获取ERR_CONNECTION_REFUSED。

然后我意识到vs代码调试器没有启动服务器。

简单

$ npm start 
在命令行

启动调试器之前,这解决了我的误解: - $

相关问题