Saturday, November 03, 2018

React 16 not working in IE11, blank screen

I got these errors in IE11 and the React app was not rendering in IE11, it just shows a blank screen.

SCRIPT5009: 'fetch' is undefined
main.chunk.js (1020,3)

SCRIPT5009: 'Promise' is undefined
1.chunk.js (29037,9)


Fix,

Installed whatwg-fetch  and @babel/polyfill

npm install whatwg-fetch --save
npm install @babel/polyfill --save

After installation we need to include it in index.js

import 'whatwg-fetch';
import '@babel/polyfill';

This has to be done before importing React.


No comments:

Get Indian financial year based on date

This function lets you get the start and end date of Indian financial year based on given date. This can also be modified for US financia...