Skip to content

React.act is not a function #1399

Closed
Closed
@ziimakc

Description

@ziimakc

When NODE_ENV is set to production tests will fail with the following error:

TypeError: React.act is not a function
 ❯ exports.act ../../node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-test-utils.production.js:20:16
 ❯ ../../node_modules/.pnpm/@testing-library+react@16.3.0_@testing-library+dom@10.4.0_@types+react-dom@19.1.3_@type_663406122d5b9765f6653a6e4ab277b1/node_modules/@testing-library/react/dist/act-compat.js:47:25

Same issue: #1392

  • "vitest": "3.1.2"
  • "@testing-library/dom": "10.4.0",
  • "@testing-library/react": "16.3.0",
  • "react": "19.1.0",
  • "react-dom": "19.1.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions