Hi Guys,
Getting error in when npm run build is run. This project is working fine in local. Please check.
Hi Guys,
Getting error in when npm run build is run. This project is working fine in local. Please check.
Hi @fs-projects , welcome and thanks for posting.
Module not found: Error: Can’t resolve ‘@mui/material/ToolBar’ in "/opt/build/repo/src/components/Header*
Make sure you are importing the module like the below.
import Toolbar from '@mui/material/Toolbar';
// or
import { Toolbar } from '@mui/material';
Finally also make sure you have properly installed MUI by following the official MUI documentation below
Also checkout the answer below by @coelmay if you have used different package managers in your project.
https://answers.netlify.com/t/module-not-found-error-cant-resolve-mui-material-utils-in-opt-build-repo-node-modules-mui-icons-material-utils/74028/4?u=clarnx
Let me know if the suggestions above works or not.
Thanks.
thanks for your reply. I am using this syntax in my project.
import Toolbar from ‘@mui/material/Toolbar’;
You can refer to my repo : GitHub - fs-projects/travel-advisor-app: Website to display hotels, restaurants and attractions in your area.
I did check the supporting answer from @DennyAzevedo and I don’t have yarn in my project anywhere. npm run build works fine in my local but errors out in netlify container. Please let me know if you have any other advice. Thanks
It’s supposed to be Toolbar
and not ToolBar
:
Thanks Man! It’s always the small things that matter in the end
Thank you @hrishikesh