-
Notifications
You must be signed in to change notification settings - Fork 833
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
Failing tests with react testing library, vitest and [email protected] #2974
Comments
does upgrading react version work? |
facing a similar error
|
Haven't had the time to try. If a minor react version upgrade fixes it it will be nice |
The root of the issue is with React 17: I'd recommend to upgrade to React 18 and also pin your dependencies as this most definitely sounds like an "accidental" upgrade:
Otherwise have vitest resolve your @radix-ui deps instead of Node
|
Bug report
There seems to be an issue while testing with vitest and rendering Radix components.
Current Behavior
When trying to run the test an error occurs
Expected behavior
To not fail.
Reproducible example
I did not manage to get the test running in one of the codesandboxes. This is a minimal public repo I have created, with a workflow setup where you can see the error.
https://github.com/dimitur2204/radix-vite-testing
Suggested solution
I have no idea where the problems stems from. No suggested solution
My first assumption is it has something to do with the react version. Since I have seen these react/jsx-runtime errors with react 17 before.
Additional context
I have another branch on the repository with the reproduction called
npm
, where I usenpm
instead ofpnpm
. The result is the same.This error started occurring in one of my company's private repos a couple of days ago. I ran workflows on commits that were previously not failing. They started failing out of nowhere with this exact error. We have not upgraded any versions of radix components at all these past days.
Your environment
The text was updated successfully, but these errors were encountered: