-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tests fail with React 19 | Error: Uncaught [Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.] #1371
Comments
You're likely using a 3rd party dependency that inlined the JSX runtime. Please reduce the issue to as little code as possible. Remove every source code and dependency until the issue no longer reproduces. |
Hm ok. Now I only have these deps:
But still get this error with a simple component:
It still fails with the same error. When I directly put the |
Then the issue is with |
I was facing the same issue and it was a 3rd party dependency which required React 19 and it was returning bad JSX as @eps1lon mentioned. |
It is fixed for me. It seems the related dependency was updates as well. Wasn't able to find the wrong one before. Thanks guys for your feedback! |
@testing-library/react
version: 16.1.0Relevant code or config:
test + component:
What you did:
Run the test with jest and get the error after updating to React 19.
What happened:
Get the error:
console.error
Error: Uncaught [Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.]
Reproduction:
Problem description:
Suggested solution:
The text was updated successfully, but these errors were encountered: