Everytime I start my application I get this. I don't use SSL and I am connecting to localhost:4200.
WebSocket is closed before the connection is established
What would cause this?
I am also getting this problem with asp.net core and Angular 7.2.0. As I just tested it doesn't exist with Angular 6.1.10
This happens when using in startup.cs:
app.UseSpa(spa => {
spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
});
When my asp.net core is running on other port. Any ideas how to solve it? The only workaround is to add http interceptor in angular with base url for my asp.net web api, but the UseProxyToSpaDevelopmentServer was definitely easier way.
Even better workaround is to use proxy on angular side with proxy.conf.json https://angular.io/guide/build#proxying-to-a-backend-server
I had this message as well and for me it seems like the cause was service scoping. I had a service in the Providers section of a component for auth / login that caused it to be scoped locally. From what I could see it happened after the post login navigation to another page. I removed it from the providers list and the error went away.