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
I installed a fresh version of Vite + React (TS). Also added MUI (https://mui.com) and imported a Button component. When I default import the Button, only that module is downloaded in the network tab. However, if I import the Button as named import the whole MUI library is imported. Here are some screenshots:
Default import
Named import
I also tried migrating one of my CRA projects to Vite but ended up rendering a blank page without any errors. There are a lot of index file import/exports there and I suspect, since tree shaking isn't working, those index file somehow caused a dependency cycle which caused the renderer to silently fail. If someone has an idea how I could fix that (if there's something on my end I did wrong) please let me know.
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. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Closing as tree-shaking one is a duplicate of #8237.
There are a lot of index file import/exports there and I suspect, since tree shaking isn't working, those index file somehow caused a dependency cycle which caused the renderer to silently fail.
Describe the bug
I installed a fresh version of Vite + React (TS). Also added MUI (https://mui.com) and imported a Button component. When I default import the Button, only that module is downloaded in the network tab. However, if I import the Button as named import the whole MUI library is imported. Here are some screenshots:
Default import
Named import
I also tried migrating one of my CRA projects to Vite but ended up rendering a blank page without any errors. There are a lot of
index
file import/exports there and I suspect, since tree shaking isn't working, those index file somehow caused a dependency cycle which caused the renderer to silently fail. If someone has an idea how I could fix that (if there's something on my end I did wrong) please let me know.Reproduction
https://stackblitz.com/edit/vite-react-ts-hv4zat
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: