I am using Material UI and I am getting a nasty error on Ubuntu with the Skeleton component. While on Windows I do not get this error and everything works fine, on Ubuntu I am getting the following error:
./node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js
Attempted import error: 'alpha' is not exported from '@material-ui/core/styles'.
The import is taken from the official docs:
import Skeleton from '@material-ui/lab/Skeleton';
On windows package.json my dependencies are these and all works fine:
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2"
On Ubuntu it tells me that the lab is missing (and it is actually where the Skeleton should be, I do not know why on Windows it works despite not having the lab installed), so after I installed the lab the package.json on Ubuntu is this:
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60"
And here is where I get the error I mentioned on the top.
Any idea why this happens?
It is because your @material-ui/lab
is the latest version but the core is not the latest one. Upgrading @material-ui/core
to 4.12.1 (or latest
) version would solve this error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With