Home > Blockchain >  Module not found: Can't resolve '@mui/icons-material/Polyline'
Module not found: Can't resolve '@mui/icons-material/Polyline'

Time:12-29

I am trying to use this material ui icon in react. It has been imported as follows:

import PolylineIcon from '@mui/icons-material/Polyline';
.
.
return (<PolylineIcon className={classes.icon} />); // Module not found: Can't resolve '@mui/icons-material/Polyline'

But I get the aforementioned error and npm fails to compile. What's the problem here? Knowing that I am using other icons smoothly with no errors; such as:

import EditIcon from '@mui/icons-material/Edit';
.
.
.
return (<EditIcon className={classes.icon} />); //works fine

This compiles fine, so @mui/icons-material module is indeed installed and works.

Dependencies from package.json:

    "@mui/icons-material": "^5.0.1",
    "@mui/material": "^5.0.2",

Thanks in advance

CodePudding user response:

The polyline icon was added later. Update your @mui/icons-material to ^5.2.5.

CodePudding user response:

Polyline seems to have been added to @mui/icons-material in the release v5.2.0 from this pull request.

You should update @mui/icons-material at least to version 5.2.0 to use Polyline icon

  • Related