. Advertisement .
..3..
. Advertisement .
..4..
Even though we have installed material-ui/lab, we are still experiencing the can’t resolve ‘@material-ui/lab/AdapterDateFns’ issue. In our following article, let’s find out all possible answers to solve this problem. Let’s begin!
What is error ‘@material-ui/lab/AdapterDateFns’ ?
The following error occurs when we try to install the material-ui/lab.
Can't resolve '@material-ui/lab/AdapterDateFns'
How To Solve The Issue?
This is a fairly common mistake for coders. To fix the error, you can approach in some of the following directions:
– Install/upgrade the current version from 5.0.0-alpha.24 or higher.
– Install @material-ui/core and @material-ui/lab
Here are the specific steps to do, follow and choose the plan that is right for you:
Solution 1
Ensure you’re running 5.0.0-alpha.24 or above. Then, define these two lines in the package.json.
{
"dependencies": {
"@material-ui/core": "5.0.0-alpha.24",
"@material-ui/lab": "5.0.0-alpha.24",
},
}
It should have fixed the error.
Solution 2
Or simply run the following command:
npm install @mui/lab
Solution 3
Run material-ui/core and material-ui/lab. Execute each command one at a time. Remove the node modules directory, then execute the following lines.
npm install @material-ui/core@next
npm install @material-ui/lab@next
Execute npm install to rebuild node module
npm install
Your error has been solved.
Conclusion
We know that the can’t resolve ‘@material-ui/lab/AdapterDateFns’ error can be confusing at first, but we hope that this post has helped explain what’s going on and how to resolve the issue.
If you have any questions about this error or any other issues with your project, please contact us anytime. Thank you for reading!
Leave a comment