Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

'Set' is undefined in IE 11 document mode 10 #169

Closed
holysnake91 opened this issue Sep 29, 2017 · 5 comments
Closed

'Set' is undefined in IE 11 document mode 10 #169

holysnake91 opened this issue Sep 29, 2017 · 5 comments

Comments

@holysnake91
Copy link

Getting this error 'Set' is undefined in IE 11 document mode 10.

If change to document mode 11 no issue, but we can't control the user IE settings.

Attached the picture where the code giving the issue.

image

@ltaalesh
Copy link

ltaalesh commented Oct 3, 2017

React 16 requires polyfilling Map and Set: https://reactjs.org/docs/javascript-environment-requirements.html

This fixes the problem for production builds, but I haven't been able to get it working in development mode. I'm guessing it requires modifying webpack config, but this in turn requires ejecting and I would like to avoid that.

There is a discussion in create-react-app repository about including these polyfills by default.

@holysnake91
Copy link
Author

Yes after add the
import 'core-js/es6/map';
import 'core-js/es6/set';

it work for the production build

@wmonk
Copy link
Owner

wmonk commented Oct 17, 2017

@holysnake91 is this fixed now, if so please close this issue 😄

@holysnake91
Copy link
Author

holysnake91 commented Oct 17, 2017

It only work on production build but not dev build

@DorianGrey
Copy link
Collaborator

As mentioned by @paradox22 , it is still under discussion about if and how to include these polyfills, since they are required for the majority of the browsers, thus generating additional bundle size without any benefit.
The consideration ticket can be found here:
facebook/create-react-app#3343

Due to the intended feature parity, I'd say we should not go ahead with a different way here. Until then, you have polyfill your project properly yourself.

Until then, including appropriate polyfills before the first import of react (e.g. on top of the index.tsx) will help. E.g. using core-js.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants