简体   繁体   中英

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.

For the sake of testing, I created a dummy app using npx create-react-app and attempted to launch on 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.

Every resource online points to react needing polyfill to be viewable on IE 11 but I haven't had any success. Any pointers greatly appreciated!

What is your react-scripts version? The issue is most likely related to react-scripts version 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? .

It can still work with react-scripts@3.2.0 . You could try to revert back to 3.2.0 as a workaround. Please also remember to delete .cache folder in node_modules and delete IE browser cache then try again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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