Skip to content

Asp.Net Core 5.0 and Angular 11 sockjs-node error #27790

@asadsahi

Description

@asadsahi

A simple asp.net core 5.0 project create using dotnet new angular then upgraded angular to latest Angular 11 and hot reload doesn't work and gives following error in browser console:

image

It works until Angular 10. This might give impression that something is broken between Angular 10 and 11. But if the same Angular 11 project is visited using https://localhost:51675 or whatever port .net runs angular app it works fine and it connects to hmr server.

One thing to note is that until Angular 10 it connects for sockjs-node on http, while .net core 5 it is trying to connect on https, which fails as can be seen in above error screenshot. I have tried disabling app.UseHttpsRedirection(); line in Startup.cs but same error.

To Reproduce

Minimal repo:

https://github.com/asadsahi/dotnet-angular11

Further technical details

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-spainvestigate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions