I am trying to debugg my angular code with vscode but doesnt work.
Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222
I'm not sure you still need it, but I found the solution, since I was facing the same issue myself.
You must launch Chrome with remote debugging enabled in order for the extension to attach to it.
Windows
Right click the Chrome shortcut, and select properties In the "target" field, append --remote-debugging-port=9222 Or in a command prompt, execute /chrome.exe --remote-debugging-port=9222
OS X
In a terminal, execute /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
Linux
In a terminal, launch google-chrome --remote-debugging-port=9222
I've found this info on the vs code chrome extension's github: https://github.com/Microsoft/vscode-chrome-debug
Note - If you have already running instances of Chrome. Close them first before opening the updated Chrome window. Ref:- https://github.com/Microsoft/vscode-chrome-debug/issues/111
I got this error because I forgot to close the chrometabs from the previous time the application ran. Just close those tabs and you are up and running again.
If you running this application in windows, and show you this message, try just restart your machine. This works for me!
Add-on to the details added by digaomatias
Note: Stop already running Chrome instances/tabs before opening the updated Chrome window.
Reference from Github.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With