question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support developing in IE 9

See original GitHub issue

I have created a new reactjs project using create-react-app and am finding it’s not working on IE10 & IE9. I have done a lot of research and it led me to using polyfills, which I have done with many of my other Rails on React app, but I’m finding it not working with this project created via create-react-app.

Here’s the error:

SCRIPT5009: 'Map' is undefined

I notice this error is related to ES6’s new Map() function.

So, here’s what I’ve done in my code in an attempt to make it work:

import './polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { BrowserRouter } from 'react-router-dom';
import 'bootstrap/dist/css/bootstrap.min.css';

const app = (
  <BrowserRouter basename={process.env.PUBLIC_URL}>
    <App />
  </BrowserRouter>
);

ReactDOM.render(app, document.getElementById('root'));

Polyfill.js:

import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/fn/object/assign';

This isn’t working. I’m not sure what else to try. I’ve tried a lot of other polyfill imports as well and continue to get the same error.

Any help would be appreciated!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
lujbcommented, Dec 5, 2018

@ivoborisov I have also got sucked into this problem recently, and I can’t wait the release of 3.0 to develop in IE 9, so I spent hours to fix it locally.

This problem is caused by react-dev-utils/webpackHotDevClient provided by CRA to bring better user experience. The custom webpackHotDevClient introduced chalk module accidentally which in turn have a dependency of ansi-style module, and the final module used es6 Map feature which sucks in IE 9. Unfortunately, webpackHotDevClient is loaded prior to the polyfilled app code, so IE 9 complaines that ‘Map’ is undefined.

Fix: Eject CRA locally and then locate the entry config in config/webpack.config.dev.js .

  1. exchange the position of the two entries OR
  2. use the stock client OR
  3. remove the chalk code in react-dev-utils/webpackHotDevClient (chalk seems unnessesary)
3reactions
Timercommented, Nov 15, 2018

It is a known limitation that the dev server does not support IE9/11. We’re working on adding this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS3 Support in Internet Explorer 9 - Impressive Webs
I've created a few charts showing CSS3 support in IE9 Beta. The list does not include every conceivable CSS3 property or selector.
Read more >
Search results for 'Internet+Explorer+9' - Office.com
Internet Explorer 9 or Internet Explorer 8 on Windows 7 or on Windows Vista SP2. Start Registry Editor. Locate and then select the...
Read more >
Why You Should Stop Supporting IE10, IE9 and IE8 - Xfive
Once you stop worrying about legacy IE versions, your web development will be easier and more cost effective. Differences in supported features between...
Read more >
Internet Explorer 9 - Wikipedia
Internet Explorer 9 supports ECMAScript 5 (ES5), several CSS 3 properties and embedded ICC v2 or v4 color profiles support via Windows Color...
Read more >
IE9 & IE10 Support - Benefitfocus
As of January 12, 2016, Microsoft no longer supports Internet Explorer 8 (IE8), Internet Explorer 9 (IE9) or Internet Explorer (IE10), stating that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found