core-js: Test error after upgrading to corejs 3

After using {corejs: 3} option for both @babel/preset-env and @babel/plugin-transform-runtime, and using @babel/runtime-corejs3, my tests are failing with the following error:

/node_modules/core-js-pure/internals/well-known-symbol.js:10
  return store[name] || (store[name] = NATIVE_SYMBOL && Symbol[name]
                                                              ^
TypeError: Cannot read property 'iterator' of undefined

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

After using {corejs: 3} option for both @babel/preset-env and @babel/plugin-transform-runtime

You should you corejs: 3 in @babel/preset-env OR in @babel/plugin-transform-runtime, but not together.

@nicolo-ribaudo already answered to this question.

Interesting. So, seems you use mocked window and, because of window.Math === Math, it passes current global object detection. But it’s not a real global object, so you try to use core-js in a broken environment. You should use core-js before that. Seems the issue resolved.

Ok, let say in other words: you should use useBuiltIns option of preset-env OR corejs option of runtime, but not together.