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 
在命令行

啓動調試器之前,這解決了我的誤解: - $

相關問題