Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Module not found: Can't resolve an @mui/icons-material icon import

ErrorModule 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.

  • Applies to Material UI (@mui/icons-material), Node.js 22, npm 10
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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/material
  2. 2Match what you see, then jump to its fix

    1. 1npm ls prints (empty) for @mui/icons-material.The icons package is not installedFix
    2. 2The icons package is present, but the build still fails or npm warns about a missing peer.The peer dependency @mui/material is missingFix
    3. 3Other icons import fine, and only this one fails.The icon name or path is not the exported nameFix

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-material

3Verify

Restart the dev server and open the page.

npm run dev

Confirmed by mui.com

Did this fix it?

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/material

2Fix

Install Material UI next to the icons.

npm install @mui/material @mui/icons-material

3Verify

Run the build.

npm run build

Confirmed by mui.com

Did this fix it?

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 dev

Confirmed by mui.com

Did this fix it?

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

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.