2

I created a react application using .net core 2.2 and as part of the set up, I added the following to the top of my index.js file:

import 'core-js/es6/map';
import 'core-js/es6/set';
import 'raf/polyfill';

It opened up and ran just fine in IE.

I'm now trying to do the same using .net core 3.0 and I'm having trouble getting it to work in IE. How do I support a react in IE, that is built in .net core 3.0?

The console shows the following 2 errors:

SCRIPT1002: Syntax error 0.chunk.js (45, 34)

AND

SCRIPT1002: Syntax error main.chunk.js (60, 1)

  • The error points to the arrow function which is es6 syntax not supported by IE 11. You need to add extra polyfills to make it work on IE 11 or other old browsers. You could refer to [this thread](https://stackoverflow.com/questions/43756211/best-way-to-polyfill-es6-features-in-react-app-that-uses-create-react-app) and [this thread](https://stackoverflow.com/questions/56435589/starter-create-react-app-with-ie11-polyfill-import-still-aborts-in-ie11) about polyfill es6 features in React app. – Yu Zhou Nov 01 '19 at 07:18
  • I found the solution to this here: https://stackoverflow.com/questions/48519960/set-or-map-is-undefined-in-ie9-reactjs – Mike Sterling Nov 22 '19 at 18:31

0 Answers0