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

Upgrading to 5.16.1 ignores defaultProps in MUI theme #42946

Closed
cvollmer opened this issue Jul 15, 2024 · 1 comment
Closed

Upgrading to 5.16.1 ignores defaultProps in MUI theme #42946

cvollmer opened this issue Jul 15, 2024 · 1 comment
Assignees
Labels
customization: theme Centered around the theming features package: system Specific to @mui/system

Comments

@cvollmer
Copy link

cvollmer commented Jul 15, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/react-mui-forked-r9hlwm

Steps:

  1. If I set the mui package versions to ~5.15 in package.json, it works and I see the defaultprop of contained on buttonbase applied.
  2. if I set the muil package versions to ~5.16, I get the following error: Could not find module in path: '@mui/material/InitColorSchemeScript/InitColorSchemeScript' relative to '/node_modules/@mui/material/styles/CssVarsProvider.js'

Current behavior

an error happens if the app uses the latest release of mui and I can't apply defaultProps in the theme.

Expected behavior

using version 5.16.1 should function like 5.15.21

Context

I had my app set to ^5.15.21 which automatically used 5.16.1 when it was released and that broke my site. I have it locked to ~5.15 now but will need to upgrade at some point.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: defaultprops ignored

@cvollmer cvollmer added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 15, 2024
@zannager zannager added package: system Specific to @mui/system customization: theme Centered around the theming features labels Jul 16, 2024
@siriwatknp
Copy link
Member

siriwatknp commented Jul 16, 2024

@cvollmer From the link you provided, it works for me. Can you try v5.16.3 in your project?

If you have @mui/system explicitly installed, please update it to v5.16.3 too or delete it from the package.json because it is already a dependency of @mui/material.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: theme Centered around the theming features package: system Specific to @mui/system
Projects
None yet
Development

No branches or pull requests

4 participants