vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
778 stars 50 forks source link

"ReferenceError: foo is not defined" after upgrading to 3.4.0 #153

Closed Kamahl19 closed 9 months ago

Kamahl19 commented 9 months ago

After upgrading from 3.3.2 to 3.4.0 I am getting "ReferenceError: theme is not defined" when importing theme from Antd https://github.com/Kamahl19/react-starter/blob/main/src/common/styleUtils.ts#L3 . It seems it's caused by changes in @swc/core version 1.3.89

https://github.com/swc-project/swc/issues/8007

ArnaudBarre commented 9 months ago

This was resolved upstream, closing

Kamahl19 commented 8 months ago

@ArnaudBarre could you please release a new version with this fix? Thanks!

ArnaudBarre commented 8 months ago

The command depend on your pacage manager but you can bump the SWC version in your node_module without having a new version of the package. And probably doing remove @vitejs/plugin-react-swc && add @vitejs/plugin-react-swc should work