Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve '@mui/material' #42182

Closed
DBDev90 opened this issue May 9, 2024 · 3 comments
Closed

Module not found: Error: Can't resolve '@mui/material' #42182

DBDev90 opened this issue May 9, 2024 · 3 comments
Assignees
Labels
support: question Community support but can be turned into an improvement

Comments

@DBDev90
Copy link

DBDev90 commented May 9, 2024

Steps to reproduce

No response

Current behavior

I created my project in REACT with Typescript. I organized the folders and also the dependencies. Soon after, I added the MUI library following the steps on the website https://mui.com/material-ui/getting-started/installation/
When adding a Button using the import "@mui/material" my project presents the error Module not found: Error: Can't resolve '@mui/material'

image
image
image

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: Module not found: Error: Can't resolve '@mui/material'

@DBDev90 DBDev90 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 9, 2024
@yamahmed
Copy link

yamahmed commented May 9, 2024

Hey there, did you check your tsconfig.json file ?
sometimes you need to ensure that your tsconfig.json file is configured correctly to include MUI's module paths.
You may need to add "node_modules/@mui" to the include array.
let me know if that helps :)

@brijeshb42
Copy link
Contributor

A repo/codesandbox with the replication will be useful. We don't have any idea what build tools you are using. Maybe CRA because of react-scripts.

@brijeshb42 brijeshb42 added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 10, 2024
@brijeshb42 brijeshb42 self-assigned this May 10, 2024
@brijeshb42 brijeshb42 added the support: question Community support but can be turned into an improvement label May 10, 2024
@DBDev90
Copy link
Author

DBDev90 commented May 10, 2024

I solved the problem by deleting the node_modules folder and also the yarn.lock file, then I installed the dependencies again with 'npm i'.

I appreciate the help.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels May 10, 2024
@zannager zannager removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

4 participants