-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[pigment] Exception when importing xxxClasses from @mui/material barrel index #43722
Comments
Could you try importing from |
Hey, @brijeshb42. No errors when importing it like this. import Button, { buttonClasses } from "@mui/material/Button"; Although I would prefer not to import default and named exports at the same time as well as importing each component from separate path. Is there a solution where importing everything from |
I just wanted to check the behaviour. Ideally, we strive to support direct module level imports as well besides the path imports, but you might encounter slower build times due to that. |
At this point, I'd recommend using path imports instead of direct package import as far as Pigment CSS is concerned since that'll also affect the overall build time. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @abriginets 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. |
@brijeshb42 Is this Material UI specific or does it impact any dependencies built on Pigment CSS? That is then published on npm? If it's the latter, I think we need an open issue in https://github.com/mui/pigment-css to keep track of this. It's no longer about Material UI but about:
In any case, it looks like we need an issue as it looks like there is more to do even. Shouldn't we:
|
So, this is expected and it's just a matter of missing documentation, right? I would like to proceed with the migration to Pigment but I'm not sure if I should spend time on changing imports across the entire codebase. It could be very annoying to track sometimes since VSCode's autocomplete always suggest using top-level imports |
Steps to reproduce
Link to live example: https://codesandbox.io/p/devbox/lingering-shape-s9cvl7?file=%2Fsrc%2Fapp%2Fpage.tsx
Steps:
styled
from@mui/material-pigment-css
Current behavior
NextJS fails to build and re-throws an exception from pigment
Expected behavior
Pigment should be able to successfully build styles using class names just like it does with colors for instance
Context
Migrating to V6 + pigment
Your environment
npx @mui/envinfo
Search keywords: pigment, pigment-css, buttonClasses
The text was updated successfully, but these errors were encountered: