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
curl https://codeload.github.com/mui/pigment-css/tar.gz/master | tar -xz --strip=2 pigment-css-master/examples/pigment-css-vite-ts
cd pigment-css-vite-ts
npm install
npm run dev
Load local, as directed by vite (e.g. http://localhost:5173)
Observe page not loading, SyntaxError: Importing binding name 'default' cannot be resolved by star export entries. in console
Add @mui/material dependency
npm i --save @mui/material@latest
Update vite.config.ts to include transformLibraries option for @mui/material:
Using Vite + React + TypeScript with only @pigment-css/vite-plugin fails to load with error SyntaxError: Importing binding name 'default' cannot be resolved by star export entries. until @mui/material is added to deps and transformLibraries vite.config.ts option.
Expected behavior
Local should load without error.
Context
Ran into the issue when I manually added pigment to a fresh Vite project. After some debugging and testing example projects, found that the example in this repo is broken, but the one in mui/material is not. After some investigation, discovered the dependency and transform differences and applying the changes fixed both my project and the example.
Is this is a new dependency and examples docs are out of date or is this an unintended side-effect of some updates. Perhaps related to @mui/* internal references as noted here?
I encountered the same issue, and following these steps resolved it for me as well. Thank you, @inimicus, for discovering and sharing this solution! Adding @mui/material and updating vite.config.ts with the transformLibraries option got my project up and running without errors. It would be great if the documentation could reflect this workaround, or if there’s an update on handling this dependency.
Thanks to the pigment-css team for their work on this tool—looking forward to seeing how this evolves!
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
Note
@inimicus How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
Steps to reproduce
http://localhost:5173
)SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.
in console@mui/material
dependencyvite.config.ts
to includetransformLibraries
option for@mui/material
:export default defineConfig({ plugins: [ pigment({ theme, + transformLibraries: ["@mui/material"], }), react(), ], });
Current behavior
Using Vite + React + TypeScript with only
@pigment-css/vite-plugin
fails to load with errorSyntaxError: Importing binding name 'default' cannot be resolved by star export entries.
until@mui/material
is added to deps andtransformLibraries
vite.config.ts option.Expected behavior
Local should load without error.
Context
Ran into the issue when I manually added pigment to a fresh Vite project. After some debugging and testing example projects, found that the example in this repo is broken, but the one in mui/material is not. After some investigation, discovered the dependency and transform differences and applying the changes fixed both my project and the example.
Is this is a new dependency and examples docs are out of date or is this an unintended side-effect of some updates. Perhaps related to
@mui/*
internal references as noted here?Your environment
npx @mui/envinfo
Search keywords: vite typescript react vite-plugin
The text was updated successfully, but these errors were encountered: