skip to Main Content

i got this error and im not quite sure what is the compatibility issue is,

Problem:

Compiled with problems:
×
ERROR in ./src/App.jsx 6:0-50
Module not found: Error: Can’t resolve ‘@material/-ui/icons’ in ‘C:UsersyasriOneDriveDesktopSTUDY PROJECTreactprojsrc’

package.json:

{
"name": "reactproj",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.18",
"@mui/material": "^5.14.18",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"web-vitals": "^3.5.0"
},

3

Answers


  1. Looks like a typo in your import statement. Try these:

    import SomeIcon from '@mui/icons-material/SomeIcon';
    

    Where SomeIcon is the icon your trying to import.

    You can see the exact import statement for each MUI icon here

    Login or Signup to reply.
  2. Try performing the following operation

    npm i @material-ui/icons
    

    The link to the exact package : https://www.npmjs.com/package/@material-ui/icons

    This is what is missing. So either try to check if you are importing the correct package, else the above package installation should help.

    Login or Signup to reply.
  3. The import statement you provided contains an extra ‘/‘ in the module name.

    It should be ‘@material-ui/icons‘ instead of ‘@material/-ui/icons‘.

    Consider correcting the import statement.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search