I am getting this error whenever I try to debug my project from visual studio.
I tried adding these settings to launchSettings.json but still no difference.
What worked for me it was: disabling Chrome run on background
You can then re-enable that on Chrome advanced settings:
This was very annoying problem. I hope it can help someone else having the same issue.