Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when deps use React.lazy, convert more 'default' wrapped the component #6

Open
SheldonWatson opened this issue Aug 9, 2021 · 3 comments

Comments

@SheldonWatson
Copy link

see this demo: https://github.com/SheldonWatson/vite-commonjs-isure

when @material-ui/icons/Search use React.lazy, can't render correctly,I don't really know it's vite's bug or your plugin'bug...

@flyfishzy
Copy link
Member

It seems not the plugin's problem, because the same error is reported even when the plugin is not used.

@SheldonWatson
Copy link
Author

It seems not the plugin's problem, because the same error is reported even when the plugin is not used.

Yes, It's vite's bug, I have created an issue there。

But can you fixed the error when '@vitejs/plugin-react-refresh' and 'viteCommonJs' plugins exist together:
image

@flyfishzy
Copy link
Member

Use exclue to temporarily solve this problem, and I will look into it. Thx!

viteCommonjs({
      exclude: ['@react-refresh'],
})

flyfishzy added a commit that referenced this issue Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants