How to fix error ''Cannot connect to runtime process" when debugging Angular application with Chrome in VS code?

Viewed 870

I am trying to debug my Angular application using VScode. If I start my computer up, run the application and launch my debugger straight away it works fine.

The problem begins after I have been working a while, opening programs and opening different tabs in chrome etc.

If I try to repeat the process of launching to debugger it throws an error.

enter image description here

Cannot connect to runtime process, timeout after 10000 ms - (reason: Can't find a valid target that matches: about:blank. Available pages: ["http://localhost:9877/?id%3D580327"]).

No matter if I restart VScode, close all my browsers or whatever, nothing works. I basically have to restart my computer to get it working again (not cool).

This is my 'launch.json' which I am purposefully using port 4202

    {   // 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}"
    }
0 Answers
Related