Theme customization stop working on all MUI components (like buttons, typography, etc.).
I can still access the correct theme configuration on my custom components using makeStyle(theme => x).
The theme should work on MUI builtin component as well.
The bug above happend while upgrading @material-ui/core from version 4.2.1 to 4.3.2.
Rollback to the previous version solve the problem. Clear cache didn't help.
| Tech | Version |
| ----------- | ------- |
| @material-ui/core | v4.3.2 |
| @material-ui/styles | v4.3.0 |
| React | v16.8.6 |
You have a duplicated instance of @material-ui/styles.
I don't know what the problem was. I didn't change nothing.
Looks like reinstall it in the second time solve it.
I ran into this as well, what was the exact problem?
Can you elaborate what "You have a duplicated instance of @material-ui/styles." means @oliviertassinari? I checked all imports and also tried clean installing 馃
happened to me when upgrading to 4.4.0
I solved the issue.
It seemed to be a problem with material-ui's dependencies. In the documentation, it is clearly stated, that @material-ui/styles has to be installed. But the problem was, that internally the 4.4.0 version of material-ui used the 4.3.3 package, but locally the 4.3.0 styles package was installed so I ended up being able to use the theme and its customizations but the material-ui package used its own theme internally. I am sure, I am not the only person that ran or will run into this 馃
Installing the correct version of the styles package did not solve the problem, however. I had to wipe the node modules and the lock file and reinstall all packages to solve the issue.
@zaunermax Make sure you are using the latest version of @material-ui/core and @material-ui/styles. It should solve your problem.
@oliviertassinari I used the latest packages versions and it did NOT solve my problem. I had to remove and install @material-ui packages again to solve it. @zaunermax description of the problem is pretty accurate.
I'm guessing some inner dependency of @material-ui/styles need a version upgrade in order to fix this problem.
@moshest with core v4.4.0? We changed the approach recently to better handle this problem.
Oh, I didn't know you release a new version. I used v4.3.2.
@moshest with core v4.4.0? We changed the approach recently to better handle this problem.
Oh I did not catch that anywhere in a release note 馃 I do not have to install the styles package anymore?
@zaunermax We have changed the way core depends on the styles dependency. It requires the latest version, this should make https://github.com/mui-org/material-ui/issues/16966#issuecomment-528267480 馃挴% of the time.
@oliviertassinari seems legit, but in my case, the theming broke because an old version of the styles package was installed explicitly without seeing any warnings or errors. Thank you for your time btw by helping and commenting!
Most helpful comment
I solved the issue.
It seemed to be a problem with material-ui's dependencies. In the documentation, it is clearly stated, that
@material-ui/styleshas to be installed. But the problem was, that internally the4.4.0version of material-ui used the4.3.3package, but locally the4.3.0styles package was installed so I ended up being able to use the theme and its customizations but the material-ui package used its own theme internally. I am sure, I am not the only person that ran or will run into this 馃Installing the correct version of the styles package did not solve the problem, however. I had to wipe the node modules and the lock file and reinstall all packages to solve the issue.