Is vitest compatible with wasp (vite)?
During vitest install I keep getting following error:
2 Replies
Hi @abhinav3295. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, there is no specific information about the compatibility of Vitest with a specific version of Vite in the context of Wasp. However, Wasp does support testing web apps through Vitest as mentioned in the Wasp documentation (https://wasp-lang.dev/docs/project/testing#testing-your-react-app).
The error you're encountering seems to be a dependency conflict between the versions of Vite required by your project and Vitest. It appears that
@vitest/mocker
is expecting Vite version ^5.0.0
, but your project is using Vite version 4.5.3
.
You might need to update your Vite version to resolve this issue. However, before doing so, ensure that the newer version of Vite is compatible with Wasp and other dependencies in your project.
If the issue persists, it would be best to reach out to the Wasp community or check the official Wasp GitHub repository for any similar issues or solutions.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @abhinav3295, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?It seems that vitest wants a specific version of Vite, while Vite that comes with Wasp is older, and that is an issue.
I would suggest using older version of vitest, or waiting for Wasp to update the version of Vite.