“加载资源失败:net::ERR_HTTP2_PROTOCOL_ERROR";升级到 Visual Studio 2019 16.10.0 后的 React 应用程序 [英] "Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR" for React app after upgrading to Visual Studio 2019 16.10.0

查看:585
本文介绍了“加载资源失败:net::ERR_HTTP2_PROTOCOL_ERROR";升级到 Visual Studio 2019 16.10.0 后的 React 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到 VS 16.10.0(然后是 16.10.1)社区版后,React 网站不再在 Visual Studio/IIS Express 中运行.完全相同的代码刚刚部署到 Azure 应用服务并且可以正常工作.

Chrome (Version 91.0.4472.77 (Official Build) (64-bit)) 调试器控制台首页为空白并显示以下错误

加载资源失败:net::ERR_HTTP2_PROTOCOL_ERROR"

解决方案包括:

  • C# 类库 (.NET Core 3.1)
  • C# Web API (.NET Core 3.1)
  • React 网站

我尝试了以下方法:

  • 清理和重建解决方案
  • 清除浏览器缓存
  • 卸载并重新安装 Visual Studio
  • 将 Visual Studio 从 16.10.0 升级到 16.10.1
  • 运行 npm run build,没有错误

附加说明:我能够使用 Visual Studio 2019 v16.9.4 而不是 v16.10.1 还原虚拟机.然后我一步一步安装了最新的 Windows 更新和确切的代码库.该站点在 v16.9.4 中正常运行.所以问题似乎出在 Visual Studio v16.10.0/v16.10.1

前往 VS 开发者社区并为这个问题投票

此外,安装了 2 个新的更新 KB5003690 和 KB5003537,但没有任何变化,我仍然有烦人的错误.之前开始出错的 KB5003637 和 KB5004476 更新已在此处消失.

卸载这些更新作为解决方法对我来说并不是最好的解决方案,因为在想要更新 Windows 10 时会重新安装它们(不再有排除/隐藏更新的选项).

对我来说,目前最简单/最快的解决方法是在本地测试,没有加载资源失败:net::ERR_HTTP2_PROTOCOL_ERROR"错误,没有系统线程异常未处理"蓝屏!错误,最重要的是不再有压力:),正在 Visual Studio 中项目的调试设置中禁用 SSL.(右键单击下面的项目、属性、调试、Web 服务器设置).

希望这能尽快解决!

亲切的问候,莱斯特.

After upgrading to VS 16.10.0 (and then 16.10.1) Community Edition a React website no longer runs w/in Visual Studio/IIS Express. The exact same code was just deployed to an Azure app service and works correctly.

The home page is blank and the following error is displayed in the Chrome (Version 91.0.4472.77 (Official Build) (64-bit)) debugger console

"Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR"

The solution consists of:

  • C# class library (.NET Core 3.1)
  • C# Web API (.NET Core 3.1)
  • React website

I have tried the following:

  • Cleaned and rebuilt solution
  • Cleared browser cache
  • Uninstalled and re-installed Visual Studio
  • Upgraded Visual Studio from 16.10.0 to 16.10.1
  • Ran npm run build which ran with no errors

Additional Note: I was able to restore a virtual machine w/ Visual Studio 2019 v16.9.4 instead of v16.10.1. Then step by step I installed the latest Windows updates and the exact code base. The site runs correctly in v16.9.4. So the problem seems to be in Visual Studio v16.10.0/v16.10.1

Go to the VS Developer Community and up vote this problem

https://developercommunity.visualstudio.com/t/Failed-to-load-resource:-net::ERR_HTTP2_/1446262

解决方案

This error was driving me nuts too. Windows 10 was updated 2 days ago and I also updated Visual Studio to version 16.10.1. After that, I got the errors, images, CSS not loading correctly.

As SpeedOfSpin mentioned in a comment in a previous post, uninstalling KB5003637 worked instantly for me, no more errors! Everything loads perfectly now. It wasn't necessary to go back to an earlier version of Visual Studio, it seems it was Windows OS related.

@SpeedOfSpin: Thnx a lot! :)

UPDATE ON ISSUE 1 Today there was a new update KB5004476, I don't see the previous KB5003637 anymore here. KB5004476 is causing the same errors. When installed I get the exact same error "Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR", uninstalling solves it instantly again. I have asked the Microsoft forum what is going on here: https://answers.microsoft.com/en-us/windows/forum/windows_10-networking/kb5003637-and-the-new-kb5004476-gives-error-failed/db2f2f73-7f5c-477a-b212-5f13c998a09a

UPDATE ON ISSUE 2 As they couldn't provide a solution in the first MS forum (previous link), the same question has been asked here: https://docs.microsoft.com/en-us/answers/questions/440339/kb5003637-and-the-new-kb5004476-gives-error-34fail.html Updating Visual Studio to version 16.10.2. doesn't solve the issue either.

UPDATE ON ISSUE 3 After some more testing, it seems it affects the browser Chrome only (As I only use Chrome, as most people do). In Firefox, Edge, and IE it seems I'm not having this issue. It was confusing as I tried so many things and the only solution I still have is uninstalling the KB5003637 or the new version KB5004476. So I guess something is wrong with Chrome after all. For now, I will keep the updates uninstalled, I don't feel like changing my preferred browser.

UPDATE ON ISSUE 4 It is indeed not a Chrome-only issue, sorry guys. Saw the same error in Edge this morning too. It took a long while to recreate the problem, while in Chrome I have it every single time. :(

UPDATE ON ISSUE 5 As asked in the first post here by ChrisP, go to the VS Developer Community if you experience this issue too, and please upvote this problem. I asked the question there also, but still no solid solution at this point.

https://developercommunity.visualstudio.com/t/Failed-to-load-resource:-net::ERR_HTTP2_/1446262

UPDATE ON ISSUE 6 Two days ago after 1 single refresh (F5), when testing my web application, aside from the HTTP/2 errors, I also had the same blue screen like people are starting to mention. It showed the error "System Thread Exception not Handled" in file "HTTP.sys" and restarted, amazing!

Also, 2 new updates were installed KB5003690 and KB5003537, but nothing changed, I still have the annoying errors. Previous updates KB5003637 and KB5004476, where it started to go wrong, are gone here.

Uninstalling these updates as a workaround isn't the best solution for me, as they get reinstalled when wanting to update Windows 10 (No option anymore to exclude/hide the updates).

For me the easiest/quickest workaround at this point, to test locally with no "Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR" errors, no "System Thread Exception not Handled" BSoD! error and most important no stress anymore :), is disabling SSL in the debug settings of your project in Visual Studio. (Right-click Project, Properties, Debug, Web Server Settings below).

Hope this gets fixed quickly!

Kind regards, Lester.

这篇关于“加载资源失败:net::ERR_HTTP2_PROTOCOL_ERROR";升级到 Visual Studio 2019 16.10.0 后的 React 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆