-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
NextJS/MUI/TSS - Cannot read properties of undefined (reading 'classes') #196
Comments
Hello @yamakhalah, Very sorry about the bad experience and thanks for reporting. This is very strange, what happen if you move your makeStyles call withing your component? function Home(){
const { classes } = useStyles();
// ...
}
const useStyles = makeStyles()(theme=> {/*...*/}); I'm not suggesting you refactor your code, it's just for figuring out what's going on... Beside I noticed you used gridItemFlex: {
"&&": {
padding: '3rem 1rem 3rem 1rem'
},
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}, |
Indeed, if I put the makeStyle directly in the page code, it works... Very strange behavior, as I have the same structure for managing styles in sub-components and it works without a problem. |
I think you might have a circular import issue in your codebase. In my repo I usualy setup this Webpack plugin: https://www.npmjs.com/package/circular-dependency-plugin Hope it helps |
Hello,
I get a strange behaviour only when i build my project (works in dev mode).
Style:
I call the function in my home page:
Help me to understand please... :)
The text was updated successfully, but these errors were encountered: