N. Warfield
N. Warfield

Reputation: 346

vscode-chrome-debug Failed to load resource ERR_CONNECTION_REFUSED

Installed the vscode-chrome-debug extention and attempted to launch an angular.js site. I'm able to connect to the chrome debugger, but accessing any resources via localhost:9009 like /index.html or /json fail to load. Running chrome with developer mode on to disable extensions.

Has anyone dealt with this before? Is this a bug in the extension? If anyone sees anything I'm doing wrong please let me know. Thanks!

enter image description here

launch.json

        {
            "name": "Launch localhost",
            "type": "chrome",
            "request": "launch",
            "url": "http://localhost:9009/index.html",
            "webRoot": "${workspaceRoot}",
            "diagnosticLogging": true,
            "userDataDir": "c:\\out\\chrome\\",
            "sourceMaps": false
        }

debug console output

      ›OS: win32 ia32
      ›Node: v5.10.0
      ›vscode-chrome-debug-core: 0.1.7
      ›debugger-for-chrome: 0.4.6
      ›spawn('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', ["--remote-debugging-port=9222","--no-first-run","--no-default-browser-check","--user-data-dir=c:\\out\\chrome\\","http://localhost:9009/index.html"])
      ›Attempting to attach on 127.0.0.1:9222
    Failed to load resource: net::ERR_CONNECTION_REFUSED (http://localhost:9009/index.html)

Upvotes: 4

Views: 5793

Answers (1)

N. Warfield
N. Warfield

Reputation: 346

There's a missing step in my setup... I need to run a web server! Seems obvious but I was under the assumption that the debug extension was doing something under the covers to serve up the site given the static file location.

I setup a gulpfile and task to run a gulp-webserver. I ran the launch task and then launched the debugger and it worked.

Upvotes: 5

Related Questions