-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Using Material UI + NextJS: "Prop did not match. Server: Client:" #4249
Comments
Hello, I am facing the same issue.
|
Did you start from https://github.com/mui-org/material-ui/tree/master/examples/nextjs? |
@oliviertassinari thank you for your reply. yes I actually used the wrapper withRoot from the example before v6 was released. I would be glad to help fix the issue if I can but I am not quite sure where to start looking at for debugging this. |
@fredsh Follow mui/material-ui#11209 then. |
I was stuck on this for some time because I had overlooked the (very important) |
Hey guys, Everything worked. |
Im still getting the same issue. Any recommended fix |
@kutsyk link to the example returns 404. Could you provide working example? |
Let's close this issue as it has been solved #4249 (comment) |
Otherwise: Warning: Prop `className` did not match. Server: "MuiSvgIcon-root-53" Client: "MuiSvgIcon-root-1" vercel/next.js#4249 (comment)
Otherwise: Warning: Prop `className` did not match. Server: "MuiSvgIcon-root-53" Client: "MuiSvgIcon-root-1" vercel/next.js#4249 (comment)
Otherwise: Warning: Prop `className` did not match. Server: "MuiSvgIcon-root-53" Client: "MuiSvgIcon-root-1" vercel/next.js#4249 (comment)
Otherwise: Warning: Prop `className` did not match. Server: "MuiSvgIcon-root-53" Client: "MuiSvgIcon-root-1" vercel/next.js#4249 (comment)
I would love to see a write up explaining what is going on with the nextjs example. _app.js, _document.js, and getPageContext.js files are all custom built to make sure Material UI can be themed properly in next. I'm try to learn next, react, and material-ui and the things that are happening in those files are like magic at the moment. |
@offero I personally wish we could wrap all the logic in a plugin so people don't have to worry about it. |
Any update on this? I really have no idea what's going on in that example. It seems this is only a problem when using the Next dev server when loading changes. |
This comment has been minimized.
This comment has been minimized.
page not found! |
Following this article, I managed to make it work but isn't straight forward, I hope it can help someone. |
I can't see this solved even with the simplistic material-ui example for next.js apps. This issue occurs only when I enable the
Here's a preview of the provided app's example in StrictMode. Related: |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Expected Behavior
Works without problem.
Current Behavior
Errors with "material-ui": "^1.0.0-beta.44" and "next": "^6.0.0" tried a lot of configuration with .babelrc doesn't work as expected.
When I'm using material-ui component
MuiThemeProvider
and refresh page using browser refresh not all component are rendered properly and in console there is next warning:Warning: Prop 'className' did not match. Server: "MuiTypography-root-246 MuiTypography-title-252 MuiTypography-colorInherit-265 PageComponent-flex-207" Client: "MuiTypography-root-44 MuiTypography-title-50 MuiTypography-colorInherit-63 PageComponent-flex-5"
Steps to Reproduce (for bugs)
Page component wich is container for whole app:
Context
Your Environment
Connected issue, said to move question to another issue: #3983
The text was updated successfully, but these errors were encountered: