Skip to content
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

[lab] themeAugmentation type definition is broken in v6.4.0 #45072

Closed
nekoya opened this issue Jan 21, 2025 · 3 comments · Fixed by #45031
Closed

[lab] themeAugmentation type definition is broken in v6.4.0 #45072

nekoya opened this issue Jan 21, 2025 · 3 comments · Fixed by #45031
Assignees
Labels
bug 🐛 Something doesn't work component: button This is the name of the generic UI component, not the React module! component: LoadingButton The React component. typescript

Comments

@nekoya
Copy link
Contributor

nekoya commented Jan 21, 2025

Steps to reproduce

Steps:

  1. Create a new project, for example npm create vite@latest
  2. Set "skipLibCheck": false in your tsconfig
  3. Install MUI and @mui/lab
  4. Add the line import type {} from "@mui/lab/themeAugmentation";
  5. Run tsc, for example npx tsc --noemit --project tsconfig.app.json

Current behavior

Type errors have occurred.

node_modules/@mui/lab/themeAugmentation/overrides.d.ts:1:10 - error TS2724: '"../LoadingButton"' has no exported member named 'LoadingButtonClassKey'. Did you mean 'ButtonClassKey'?

1 import { LoadingButtonClassKey } from '../LoadingButton';
           ~~~~~~~~~~~~~~~~~~~~~

node_modules/@mui/lab/themeAugmentation/props.d.ts:2:10 - error TS2614: Module '"../LoadingButton"' has no exported member 'LoadingButtonProps'. Did you mean to use 'import LoadingButtonProps from "../LoadingButton"' instead?

2 import { LoadingButtonProps } from '../LoadingButton';
           ~~~~~~~~~~~~~~~~~~

Expected behavior

No type errors.

Context

In v6.4.0, the <Button> component supports loading attribute, and <LoadingButton> has been deprecated.

However, themeAugmentation still references deleted types.

These types were declared in v6.3.1 and earlier.

In v6.4.0, the definition for <LoadingButton> shares the same definition as Button.

Thus, type errors have occurred.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 15.2
  Binaries:
    Node: 22.11.0 - ~/.nodebrew/current/bin/node
    npm: 10.9.0 - ~/.nodebrew/current/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 131.0.6778.266
    Edge: Not Found
    Safari: 18.2
  npmPackages:
    @emotion/react: 11.14.0 => 11.14.0 
    @emotion/styled: 11.14.0 => 11.14.0 
    @mui/base:  5.0.0-beta.68 
    @mui/core-downloads-tracker:  6.4.0 
    @mui/lab: 6.0.0-beta.23 => 6.0.0-beta.23 
    @mui/material: 6.4.0 => 6.4.0 
    @mui/private-theming:  6.4.0 
    @mui/styled-engine:  6.4.0 
    @mui/system:  6.4.0 
    @mui/types:  7.2.21 
    @mui/utils:  6.4.0 
    @types/react: ^18.3.18 => 18.3.18 
    react: ^18.3.1 => 18.3.1 
    react-dom: ^18.3.1 => 18.3.1 
    typescript: ~5.6.2 => 5.6.3 

Search keywords: lab, themeAugmentation, LoadingButton, type error

@nekoya nekoya added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 21, 2025
@aarongarciah aarongarciah added typescript component: button This is the name of the generic UI component, not the React module! component: LoadingButton The React component. labels Jan 21, 2025
@aarongarciah aarongarciah moved this to Backlog in Material UI Jan 21, 2025
@aarongarciah aarongarciah changed the title The type definition of themeAugmentation in mui-lab is broken in v6.4.0 [lab] themeAugmentation type definition is broken in v6.4.0 Jan 21, 2025
@Janpot
Copy link
Member

Janpot commented Jan 21, 2025

I believe this would be fixed by #45072
You can try out this fix by adding the following resolution:

// ./package.json
"resolutions": {
  "@mui/lab": "https://pkg.csb.dev/mui/material-ui/commit/13459abd/@mui/lab"
}

@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Jan 23, 2025
@DiegoAndai DiegoAndai moved this from Backlog to In progress in Material UI Jan 23, 2025
@DiegoAndai DiegoAndai added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 23, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Material UI Jan 23, 2025
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@nekoya How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@nekoya
Copy link
Contributor Author

nekoya commented Feb 3, 2025

I confirmed that this is fixed in 6.4.2. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: button This is the name of the generic UI component, not the React module! component: LoadingButton The React component. typescript
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants