Skip to content

IE11: Cannot load Array[Symbol.iterator] polyfill #2513

@compulim

Description

@compulim

Version

master

Describe the bug

It seems core-js is loaded incorrectly. This is causing sagas/effects/forkPut.js to fail after Webpack in IE11. This bug is introduced when we bump core-js@2 to core-js@3 in PR #2195, because core-js@3 changed the import signature.

Instead of loading using import 'core-js/modules/es.symbol', we should load it using import 'core-js/features/symbol'.

I believe when we load from /features/ instead of /modules/, these features are aware of each other. For example, "symbol" is aware of "array.iterator" and complement each other. But when we are loading from /modules/, they do not aware of each other.

To Reproduce

Steps to reproduce the behavior:

  1. Create a create-react-app
    • No need to install Web Chat, we are just proving the polyfill is loaded incorrectly
  2. Copy the polyfill code from index-es5.ts to the app
  3. Run npm run build
    • CRA development build do not work with IE11, it only works with production build
  4. Host the app
  5. On IE11, browse to http://localhost:3000/
  6. In the console, run new Array()[Symbol.iterator]

Expected behavior

After running the code, it should return a function, polyfilled by core-js.

Instead, it is returning undefined.

Additional context

[Bug]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or an unintended behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions