Alvin Stefanus
Alvin Stefanus

Reputation: 2153

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

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?

Upvotes: 19

Views: 42754

Answers (8)

ajbeaven
ajbeaven

Reputation: 9582

This error also appears if the maximum size of the request is too large. The default maxrequestbytes that defines this limit is 16KB.

If you're running in a development environment, you can easily go over this limit if you are running a number of sites on localhost that use cookies (some auth cookies can take up a bit of space). Clearing cookies should help resolve this specific issue.

Upvotes: 0

dotnetdev_2009
dotnetdev_2009

Reputation: 791

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 .

Upvotes: 2

knoxgon
knoxgon

Reputation: 1243

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.

Upvotes: 2

darthbob88
darthbob88

Reputation: 91

I was able to solve this problem by uninstalling a recent Windows patch, KB5003637. https://www.windowslatest.com/2021/06/11/windows-10-kb5003637-update-could-break-your-taskbar

Upvotes: 2

Wei Pin
Wei Pin

Reputation: 73

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).

Upvotes: 4

TheQuail13
TheQuail13

Reputation: 121

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.

Upvotes: 12

peopleWatching
peopleWatching

Reputation: 71

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.

Upvotes: 7

emasnavi
emasnavi

Reputation: 462

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!

Upvotes: 16

Related Questions