简体   繁体   English

即使使用 polyfill,React 应用程序也不会在 IE 11 中呈现

[英]React app not rendering in IE 11 even with polyfills

I have a fully built React application that I would like to deploy on IE 11, but been having no success but a white page.我有一个完全构建的 React 应用程序,我想在 IE 11 上部署它,但是除了一个白页之外没有成功。

For the sake of testing, I created a dummy app using npx create-react-app and attempted to launch on IE 11/Edge.为了测试,我使用 npx create-react-app 创建了一个虚拟应用程序,并尝试在 IE 11/Edge 上启动。 Installing 'react-app-polyfill' and importing on 'react-app-polyfill/ie11' and 'react-app-polyfill/stable' on line 1 & 2 of index.js, I also included "last 1 ie version" in the browserlist.development inside the package.json file.在 index.js 的第 1 行和第 2 行安装“react-app-polyfill”并导入“react-app-polyfill/ie11”和“react-app-polyfill/stable”,我还包括“last 1 ie version” package.json 文件中的 browserlist.development。

Every resource online points to react needing polyfill to be viewable on IE 11 but I haven't had any success.每个在线资源都指出需要 polyfill 才能在 IE 11 上查看,但我没有取得任何成功。 Any pointers greatly appreciated!任何指针都非常感谢!

What is your react-scripts version?你的react-scripts版本是什么? The issue is most likely related to react-scripts version 3.3.0.该问题很可能与react-scripts 3.3.0 版有关。 You could find many issue reports in GitHub, for example: IE11 support doesn't work in dev mode, even after adding all polyfills and enabling ie11 support , Why application created using create-react-app is not working in IE browser?您可以在 GitHub 中找到许多问题报告,例如: IE11 支持在开发模式下不起作用,即使添加了所有 polyfill 并启用了 ie11 支持为什么使用 create-react-app 创建的应用程序在 IE 浏览器中不起作用? . .

It can still work with react-scripts@3.2.0 .它仍然可以与react-scripts@3.2.0一起react-scripts@3.2.0 You could try to revert back to 3.2.0 as a workaround.您可以尝试恢复到 3.2.0 作为解决方法。 Please also remember to delete .cache folder in node_modules and delete IE browser cache then try again.也请记住删除.cache文件夹中node_modules和删除IE浏览器的缓存然后再试一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM