-
-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
Related plugins
Describe the bug
@swc/core doesn't follow semver but vite-plugin-react is using caret version.
This could silently break when plugin-react-swc is packaged together with swc plugins.
For example, @swc/core@1.13.5 is only compatible with @swc/plugin-emotion@^11
(https://plugins.swc.rs/versions/range/426)
but the caret ^1.13.5 installs latest version on fresh install which breaks plugin compatibility.
To fix this we have to override the version or modify the lockfile manually which is not a great experience.
There could be two options:
- fix the version
- make it as a peer dependency
I think latter one makes more sense since swc's javascript interface is mostly consistent.
Related code
https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc/package.json
Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.