mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.38k stars 32.14k forks source link

Upgrading @mui/lab from 5.0.0-alpha.67 to 5.0.0-alpha.68 breaks makeStyles usage #31007

Closed Npervic closed 2 years ago

Npervic commented 2 years ago

Duplicates

Latest version

Current behavior 😯

Once I upgrade @mui/lab from 5.0.0-alpha.67 to 5.0.0-alpha68 my whole apps usage of makeStyles breaks with errors such as:

Screen Shot 2022-02-10 at 11 25 57 AM

And theme.x being undefined.

Expected behavior 🤔

makeStyles should not break with @mui/lab upgrade.

Steps to reproduce 🕹

Steps:

  1. upgrade @mui/lab to latest alpha

Context 🔦

I am using version 5 but still have not migrated to emotion.

Simple example of usage:

import makeStyles from '@mui/styles/makeStyles';

const useStyles = makeStyles((theme) => ({
  someStyle: {
    color: theme.spacing(2)
  },
}));

const someComponent = () => {
  const classes = useStyles();
  // .....
}

Everything works without this upgrade.

(see "Your environment" for package version of mui & related packages)

Your environment 🌎

`npx @mui/envinfo` ``` System: OS: macOS 12.0.1 Binaries: Node: 17.4.0 - ~/.nvm/versions/node/v17.4.0/bin/node Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn npm: 8.3.1 - ~/.nvm/versions/node/v17.4.0/bin/npm Browsers: Chrome: 98.0.4758.80 Edge: Not Found Firefox: 96.0.2 Safari: 15.1 ```
`mui & related packages and their version` ``` "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", "@mui/icons-material": "^5.4.1", "@mui/lab": "^5.0.0-alpha.68", "@mui/material": "^5.4.0", "@mui/styled-engine-sc": "^5.4.1", "@mui/styles": "^5.3.0", "@mui/types": "^7.1.0", ```
Npervic commented 2 years ago

Any thoughts on this?

mnajdova commented 2 years ago

It doesn't look like this bug report has enough info for one of us to reproduce it.

Please provide a CodeSandbox (https://material-ui.com/r/issue-template-latest), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

mnajdova commented 2 years ago

BTW, why do you have "@mui/styled-engine-sc": "^5.4.1", installed if you are using @emotion/react? Would be best if you can create a sandbox or a repository with the reproduction

github-actions[bot] commented 2 years ago

Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.