Skip to content

Dev build doesn't include Set polyfill #3275

Closed

Description

@Ismael

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

Activity

  1. tharakawj commented on Oct 14, 2017

    @tharakawj
    Contributor

    Already there is pending PR for this. #3200

  2. Ismael commented on Oct 14, 2017

    @Ismael
    Author

    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?

  3. gaearon commented on Nov 3, 2017

    @gaearon
    Contributor

    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.

  4. pridemusvaire commented on Apr 9, 2018

    @pridemusvaire

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

  5. locked and limited conversation to collaborators on Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions