Polyfills in 2019 for IE11

Since you are using Babel for transpilation, you can use the @babel/preset-env preset and set your target environment to be IE11*.

  1. Install the preset: yarn add @babel/preset-env --dev

  2. Configure your targets in your Babel config:

{
  "presets": [
    ["@babel/presets-env", {
      "targets": {
        "browsers": {
          "ie": "11"
        }
      },
    }]
  ]
}

*From the docs

@babel/preset-env takes any target environments you've specified and checks them against its mappings to compile a list of plugins and passes it to Babel.


In the official documentation, it says "In order to use Iterators you must include the Babel polyfill." You could try to install it with npm install --save @babel/polyfill and use it with require("@babel/polyfill") at the top of the entry point to your application.

The polyfill is provided as a convenience but you should use it with @babel/preset-env and the useBuiltIns option so that it doesn't include the whole polyfill which isn't always needed. Otherwise, we would recommend you import the individual polyfills manually.

You could also try to import core-js/fn/symbol/iterator.js.