Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempted import error: 'alpha' is not exported from '@material-ui/core/styles'

I'm trying to use the material-ui/lab date picker, however I'm getting this error! I have updated my material-ui version using npm install @material-ui/core@latest and it worked fine. However, I lost the ability to use createMuiTheme & MuiThemeProvider.

like image 434
Ibra Avatar asked Dec 08 '20 00:12

Ibra


3 Answers

Maybe it'll be helpful for someone. For me fix of that issue was to change the indirect import to direct one:

so this triggered the error:

import { Alert } from '@material-ui/lab'; 

this works fine:

import Alert from '@material-ui/lab/Alert'; 
like image 121
Ustin Avatar answered Sep 16 '22 17:09

Ustin


You should update your package.json with following:

"@material-ui/lab": "4.0.0-alpha.57", "@material-ui/pickers": "3.2.10", 
like image 20
Daniil Koziura Avatar answered Sep 19 '22 17:09

Daniil Koziura


I had the same problem with Skeleton using version @material-ui/lab": "4.0.0-alpha.60 but changing it to version @material-ui/lab": "4.0.0-alpha.57 fixed it for me ... guess they broke it again :)

like image 27
MakanMakan Avatar answered Sep 19 '22 17:09

MakanMakan