Skip to content

Dev build doesn't include Set polyfill #3275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ismael opened this issue Oct 12, 2017 · 4 comments
Closed

Dev build doesn't include Set polyfill #3275

Ismael opened this issue Oct 12, 2017 · 4 comments

Comments

@Ismael
Copy link

Ismael commented Oct 12, 2017

React 16 requires Set.
I'm developing for an older browser which does not have Set. In production mode, the project works. In dev mode, I get an Set is undefined error.

I'm importing babel-polyfill at the top of my index.js, but that doesn't work.
I tried importing core-js/es6/set directly and didn't work either.

How can I make sure the dev build includes support for legacy browsers?

Also, maybe you should include Set by default in the polyfills as this is required by React 16?

https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#supported-language-features-and-polyfills

@tharakawj
Copy link
Contributor

Already there is pending PR for this. #3200

@Ismael
Copy link
Author

Ismael commented Oct 14, 2017

But I did add those two polyfills and dev didn't work, only prod. Is there any reason for the polyfills not loading on dev?

@gaearon
Copy link
Contributor

gaearon commented Nov 3, 2017

We don't intend to include a Map, Set, or requestAnimationFrame polyfills with CRA.
You are welcome to add them yourself if you target browsers that require them.

@gaearon gaearon closed this as completed Nov 3, 2017
@pridemusvaire
Copy link

@Ismael include babel-poly-fill in public/index.html as a script tag, that will solve most of your problems.

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants