-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[icons] v7 "@mui/icons-material" typing is not working correctly for named exports #45697
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
Comments
Have the same issue after the v7 upgrade |
Same issue. Regression seems started on |
Thank you for reporting! |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. |
@Janpot Thanks for sorting this so promptly. Could you clarify what the timeline for release with this fix in it might be? |
We'll likely release a patch release before the weekend. |
I updated to |
Steps to reproduce
Minimal reproduction: https://stackblitz.com/edit/mui7-ts-icons?file=package.json
Current behavior
In v7 the wrong type information appears to be exposed for the index import path of "@mui/icons-material". The type information is that of a single icon (icon.d.ts) instead of named exports for all icons (index.d.ts). This issue is limited to the typing (the icons are actually importable as named exports).
import { AccessAlarm } from '@mui/icons-material';
results in
error TS2614: Module '"@mui/icons-material"' has no exported member 'AccessAlarm'
Expected behavior
Option 2 from the icon usage doc at https://mui.com/material-ui/icons/#usage should provide correct typing.
Context
I have offered some thoughts on a fix in MR #45695.
Your environment
npx @mui/envinfo
System:
OS: Linux 5.0 undefined
Binaries:
Node: 18.20.3 - /usr/local/bin/node
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
Browsers: n/a
npmPackages:
@emotion/react: 11.14.0
@emotion/styled: 11.14.0 => 11.14.0
@mui/core-downloads-tracker: 7.0.0
@mui/icons-material: 7.0.0 => 7.0.0
@mui/material: 7.0.0
@mui/private-theming: 7.0.0
@mui/styled-engine: 7.0.0
@mui/system: 7.0.0
@mui/types: 7.4.0
@mui/utils: 7.0.0
@types/react: 19.0.12
react: 19.0.0
react-dom: 19.0.0
typescript: 5.8.2 => 5.8.2
Search keywords: icon, types
The text was updated successfully, but these errors were encountered: