ReactJS: net::ERR_HTTP2_PROTOCOL_ERROR 200 with .NetCore in HTTPS

Viewed 23913

I use ReactJS to develop my application, it was fine before, but suddenly this error happens:

GET https://localhost:44368/static/js/0.chunk.js net::ERR_HTTP2_PROTOCOL_ERROR 200

I do not know what is happening here, it was fine before. How can I fix this?

7 Answers

I am using Visual Studio 2019 and experienced the same problem. This is what I did to resolve it:

Removed 'Microsoft.AspNetCore.SpaServices.Extentions' Nuget package from the project's Dependencies/Packages, and then installed the latest version (Installed 5.0.6)

enter image description here

Cleaned and rebuilt the solution and it started working again.

let me know if it works for you!

Don't have enough rep to comment, but wanted to drop a note saying had the exact same experience as JTM and think that the Win10 update seems to be the likely suspect. .Net Core project that worked fine last night with no changes has stopped working post-update.

This solution does not work for dotnet core. I've tried updating SpaServices.Extensions to the latest version 3.1.16.

A temporarily solution is to disable SSL under Web Server Settings.

Thanks @Alan Barber's answer. I was looking for solution without upgrading my .NET Core version (3.1) to 5.

My project back to normal after uninstalled the window update patch (KB5003637).

Remove the following update

Security Update for Microsoft Windows (KB5003637)

After removal, it will ask you to restart the computer. It will then install an older security update: probably KB5003173 which won't cause any problems.

This happened to me after the windows update and rolling that back was not possible because of corporate policy. I found a solution in this developer community link https://developercommunity.visualstudio.com/t/Failed-to-load-resource:-net::ERR_HTTP2_/1446262 (Specifically the the one by Kevin Pilch).

I added the registry entries ( 2 of them to turn off HTTP2) and it worked. Another option if the registry edit is not working is to install Fiddler and keep it running. Fiddler will force HTTP/1.1 instead of HTTP/2

Relevant sections from his post

Start the Windows Registry Editor.

  1. Navigate to the registry key 2.HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters.
  2. Add 2 new REG_DWORD values, EnableHttp2Tls and EnableHttp2Cleartext, to this registry key.
  3. Set both values to 0.
  4. Reboot the server .
Related