You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is not SWC bindings available for Stackblitz yet, so with ESM it fails just after. That's strange though, there is probably an issue with default export. Thanks for reporting!
So yeah basically this a classic interop issue, which is why we should move away from default export (or cjs, but one is simpler than the other).
I can patch esbuild output for the cjs output, but before doing that I want to know if it will be possible to support this directly in esbuild: evanw/esbuild#2733
In the meantime you can change your export to require('@vitejs/plugin-react-swc').default
When using commonjs imports
We get
TypeError: react is not a function
. It works with esm imports, but I thought this was worth bringing up.Example reproduction:
https://stackblitz.com/edit/vitejs-vite-tcrxby?file=vite.config.js
The text was updated successfully, but these errors were encountered: