core-js: Starting with 3.25.4: "wmhas is not a function"

Starting with core-js 3.25.4, I’m starting to see errors in my CI pipeline when running Storybook:

[TEST]     TypeError: wmhas is not a function
[TEST] 
[TEST]       at has (node_modules/core-js/internals/internal-state.js:44:12)
[TEST]       at enforce (node_modules/core-js/internals/internal-state.js:17:10)
[TEST]       at Object.<anonymous>.module.exports (node_modules/core-js/internals/make-built-in.js:39:15)
[TEST]       at Object.<anonymous> (node_modules/core-js/internals/make-built-in.js:47:31)
[TEST]       at Object.<anonymous> (node_modules/core-js/internals/define-built-in.js:3:19)

Workaround: Stick with 3.25.3 and things work perfectly fine.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Fixed in 3.25.5.

Avoiding uncurryThis in https://github.com/zloirock/core-js/blob/fd7812ac33079af134fc3269d236195b7b1bd9e3/packages/core-js/internals/internal-state.js#L29-L46 , replacement to

if (NATIVE_WEAK_MAP || shared.state) {
  var store = shared.state || (shared.state = new WeakMap());
  store.get = store.get;
  store.has = store.has;
  store.set = store.set;
  set = function (it, metadata) {
    if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
    metadata.facade = it;
    store.set(it, metadata);
    return metadata;
  };
  get = function (it) {
    return store.get(it) || {};
  };
  has = function (it) {
    return store.has(it);
  };
} else {

fixes wmhas problem - but without understanding what happens it could cause problems in other cases where uncurryThis is used, so anyway need to dig out what happens.