I imported the Slider:
import Slider from '@material-ui/lab/Slider';
and have returned in the render.
The code is not getting compiled and is throwing an error:
Module not found: Error:
Can't resolve '@material-ui/lab/Slider' in {path}
.
Could anyone help me with this? Thanks.
You have to install the lab package: npm install @material-ui/lab
Updated answer as of February 2021: Slider has been moved into core, so you should change your import to:
import Slider from '@material-ui/core/Slider';
Run the following command in the your terminal/ cmd :
npm install @material-ui/lab
After successful installation, restart the server. It will work properly. You can check manually in your node_modules/@material-ui. You will find lab folder in it.
Error itself shout a lot.
Module not found
That means you've to install the module
if its not part of your project.
lab doesn't come with material/core
Just install the lab package through any package manager NPM
or YARN
npm
npm install @material-ui/lab
yarn
yarn add @material-ui/lab
I would suggest to use only one package at a time, And also check if the lock file exist. Sometimes it conflicts and cause issue with the existing packages.
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