Module not found: Can't resolve an @mui/icons-material icon import
Module not found: Can't resolve '@mui/icons-material/FileDownload'Short answer
The bundler cannot find a file at that import path. Three things cause it: @mui/icons-material is not installed, its @mui/material peer is missing, or the icon name does not match the PascalCase export name. Install both packages, then copy the exact name from the Material UI icon list.
Fix it fast
1Find out which cause you have
Check whether the icons package and its peer are installed in this project.
npm ls @mui/icons-material @mui/material2Match what you see, then jump to its fix
- 1
npm ls prints (empty) for @mui/icons-material.The icons package is not installedFix - 2
The icons package is present, but the build still fails or npm warns about a missing peer.The peer dependency @mui/material is missingFix - 3
Other icons import fine, and only this one fails.The icon name or path is not the exported nameFix
- 1
What does the error look like?
Module not found: Can't resolve '@mui/icons-material/FileDownload'
Cause 1 of 3
The icons package is not installed
1Check
The icons are a separate package from @mui/material, so installing Material UI alone does not add them.
ls node_modules/@mui/2Fix
Install the package.
npm install @mui/icons-material3Verify
Restart the dev server and open the page.
npm run devConfirmed by mui.com
Cause 2 of 3
The peer dependency @mui/material is missing
1Check
The icons use SvgIcon from @mui/material, which is a peer dependency, so the project must have Material UI too.
npm ls @mui/material2Fix
Install Material UI next to the icons.
npm install @mui/material @mui/icons-material3Verify
Run the build.
npm run buildConfirmed by mui.com
Cause 3 of 3
The icon name or path is not the exported name
1Check
Material icon names are snake_case, while the package exports PascalCase names, for example delete_forever becomes DeleteForever. A variant needs its suffix, for example DeleteOutlined.
ls node_modules/@mui/icons-material/ | grep -i "^FileDownload"2Fix
Use the PascalCase name exactly, with one default import per icon path.
import FileDownloadIcon from '@mui/icons-material/FileDownload';
// or a named import from the package root
import { FileDownload } from '@mui/icons-material';3Verify
Save the file and confirm that the error is gone.
npm run devConfirmed by mui.com
How do I stop it coming back?
- Install @mui/material and @mui/icons-material together in one command.
- Copy the icon name from the Material UI icon list instead of typing it.
- Use path imports for each icon to keep the bundle small.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Web apps
webpack cannot resolve an import (Module not found)
Module not found: Error: Can't resolve 'react-dom' in '/app/src'
Can't resolve means webpack searched every place its resolver knows and found no file.
4 causes, each with a fixWeb apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fixWeb apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
React shows Attempted import error when importing a component or function
Attempted import error:
The build found the file but not the name you asked for.
2 causes, each with a fixWeb apps
AxiosError Network Error with code ERR_NETWORK in a React app
Network Error
ERR_NETWORK means the request produced no readable response.
4 causes, each with a fixWeb apps
Axios get works with a URL string but ignores the object passed as the second argument
The server log shows a GET with no query string
axios.get takes a URL and an optional config object.
3 causes, each with a fix