Skip to content

TypeError: (0 , _flags.default) is not a function #1183

Open
@smooth-man

Description

@smooth-man

Greetings!

I have a react project that runs on yarn with nodeLinker: "pnp" (zero installs), and I'm getting the following error when I try to run tests:

TypeError: (0 , _flags.default) is not a function

> 1 | import '@testing-library/jest-dom/extend-expect'
    | ^
  2 |

  at flags (.yarn/cache/core-js-pure-npm-3.28.0-172396ba34-8bef96a435.zip/node_modules/core-js-pure/internals/regexp-get-flags.js:9:12)
  at Object.<anonymous>.module.exports (.yarn/cache/core-js-pure-npm-3.28.0-172396ba34-8bef96a435.zip/node_modules/core-js-pure/es/instance/flags.js:7:75)
  at getPolyfill (.yarn/cache/regexp.prototype.flags-npm-1.4.3-df1c08b65d-51228bae73.zip/node_modules/regexp.prototype.flags/polyfill.js:9:29)
  at Object.<anonymous> (.yarn/cache/regexp.prototype.flags-npm-1.4.3-df1c08b65d-51228bae73.zip/node_modules/regexp.prototype.flags/index.js:10:27)
  at Object.<anonymous> (.yarn/cache/deep-equal-npm-2.2.0-d9712e0040-46a34509d2.zip/node_modules/deep-equal/index.js:5:13)
  at Object.<anonymous> (.yarn/cache/aria-query-npm-5.1.3-9632eccdee-929ff95f02.zip/node_modules/aria-query/lib/elementRoleMap.js:7:41)
  at Object.<anonymous> (.yarn/cache/aria-query-npm-5.1.3-9632eccdee-929ff95f02.zip/node_modules/aria-query/lib/index.js:10:46)
  at Object.<anonymous> (src/test/setup.js:1:1)

I'm using react 18.2.0, @testing-library/react 13.4.0 and @testing-library/jest-dom 5.16.5. I really can't provide any more details and I understand that this might not be enough for anything and that this might not be related to core-js at all, I'm just wondering has anyone else experienced similar issue? Thanks in advance and I apologize for the scarce information.

The issue is not present when I set the nodeLinker to node_modules, which is when yarn uses the node_modules folder approach to handle packages.

Activity

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions