Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Can't resolve '@mui/lab/AdapterDateFns'

I was using the Material UI Timepicker but after updating to MUI 5 it is not working anymore. I updated everything to @next and @material-ui/core (version 5.0.0-beta.5) and @material-ui/lab (version: 5.0.0-alpha.44).

like image 805
diabetico Avatar asked Oct 05 '21 23:10

diabetico


People also ask

What is MUI lab?

mui Lab was founded to promote societal adoption of “calm technology” – the technology that fits in with natural human behaviors and environment. Designed with users' comfort and happiness in mind, calm interfaces can further bring out the humanness of human life.


Video Answer


2 Answers

If you copy the Timepicker code from the MUI docs, you also need to install the lab package which contains the adapter code to integrate with date-fns. See the requirements here. For reference, you can see the package.json file from the live demo.

npm i @mui/lab
like image 189
NearHuscarl Avatar answered Oct 16 '22 16:10

NearHuscarl


I had the same issue. What I did was installing date-fns as well

  npm i date-fns

I then stopped the localhost server and restart it again with npm start (I was using react)

npm start
like image 43
Mm Victory Avatar answered Oct 16 '22 15:10

Mm Victory