Skip to content

Module parse failed: Unexpected token for the act-compat.js #1298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
YevheniiaChursina opened this issue Apr 11, 2024 · 1 comment
Closed

Comments

@YevheniiaChursina
Copy link

  • @testing-library/react version: 14.3.0 and above
  • Testing Framework and version: jest: ^29.7.0
  • DOM Environment: jest-environment-jsdom: ^29.7.0
  • node: v18.17.0
  • react: ^18.2.0
  • @storybook/react: "^6.4.19",

What you did:

Updating to version 14.3.0 and above causes the error

What happened:

ERR! /vercel/path0/node_modules/@testing-library/react/dist/act-compat.js 13:28
ERR! Module parse failed: Unexpected token (13:28)
ERR! You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
ERR! | function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
ERR! | function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
ERR! > const reactAct = React.act ?? DeprecatedReactTestUtils.act;
ERR! | function getGlobalThis() {
ERR! |   /* istanbul ignore else */
ERR!  @ /vercel/path0/node_modules/@testing-library/react/dist/pure.js 58:41-64
ERR!  @ /vercel/path0/node_modules/@testing-library/react/pure.js

Problem description:

Updating @testing-library/react to version 14.3.0 and above causes the error and fails the storybook build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants