Closed d4mr closed 5 months ago
Yes this is clearly an issue with SWC, maybe an incompatibility between the plugin version and the core version
I'm facing the same issue. However, I'm not sure to get how to handle this. I forced @swc/core in my project's package.json to ~1.3.107, and "deduped" my dep tree (using pnpm dedupe).
I still get the same error as @d4mr reported, on my dev computer. On stackblitz (https://stackblitz.com/edit/vitejs-vite-sqthkz?file=package.json,vite.config.ts,src%2Fmain.tsx,src%2FApp.tsx&terminal=dev) , it's working even with the latest versions, but the plugin does not seems to be run at all.
Is there any working sample somewhere, combining vite-plugin-react-swc and jotai plugin ?
Found a workaround here: https://github.com/pmndrs/swc-jotai/issues/23#issuecomment-1944195939
I added in my package.json file:
{
"pnpm": {
"overrides": {
"@swc/core": "1.3.105"
}
}
}
This way, it forces vite-plugin-react-swc to downgrade its swc dependency.
Using
@swc/core
version1.3.107
, I get this error when I try to use@swc-jotai/react-refresh
.Downgrading
@swc/core
to version1.3.101
, I no longer get this error, and everything seems to work. I am unsure whether I should file an issue there or here, please let me know if I should create one there instead.