【问题标题】:React app not rendering in IE 11 even with polyfills即使使用 polyfill,React 应用程序也无法在 IE 11 中呈现
【发布时间】:2020-02-07 01:10:22
【问题描述】:

我有一个完整构建的 React 应用程序,我想在 IE 11 上部署它,但没有成功,只有一个白页。

为了测试,我使用 npx create-react-app 创建了一个虚拟应用程序,并尝试在 IE 11/Edge 上启动。在 index.js 的第 1 行和第 2 行安装“react-app-polyfill”并导入“react-app-polyfill/ie11”和“react-app-polyfill/stable”,我还包括“last 1 ie version” package.json 文件中的 browserlist.development。

每个在线资源都指向需要 polyfill 才能在 IE 11 上查看的反应,但我没有取得任何成功。任何指针都非常感谢!

【问题讨论】:

  • 你的控制台有错误吗?
  • 控制台没有错误

标签: reactjs internet-explorer internet-explorer-11 polyfills ie11-developer-tools


【解决方案1】:

您的react-scripts 是什么版本?该问题很可能与react-scripts 3.3.0 版有关。您可以在 GitHub 中找到许多问题报告,例如:IE11 support doesn't work in dev mode, even after adding all polyfills and enabling ie11 supportWhy application created using create-react-app is not working in IE browser?

它仍然可以与react-scripts@3.2.0 一起使用。您可以尝试恢复到 3.2.0 作为解决方法。还请记得删除node_modules中的.cache文件夹并删除IE浏览器缓存再试一次。

【讨论】:

  • 谢谢,我尝试在 CRA 默认为 3.3.1 时恢复到 3.2.0,但仍然没有成功。还删除了 node_modules .cache 和浏览器缓存。它只显示“您需要启用 Javascript 才能运行此应用程序”。在 IE 11 上,但这只是
  • 你关注the steps在IE中启用JavaScript了吗?在你的IE中检查一下,如果还是不行,请提供a minimal sample to reproduce the issue
猜你喜欢
  • 1970-01-01
  • 2023-02-08
  • 1970-01-01
  • 2020-12-26
  • 2020-06-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-14
相关资源
最近更新 更多