-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Server side rendering #2336
Comments
I change the subject of the issue to server side rendering in general as I encountered yet another issue related to server-side rending. Due to this line, there is again a mismatch error, because server-side |
You are not the first one to raise this issue. |
@chadrien Thank you for the webpack fix. Its quite odd though, I am unable to produce the react warning running locally. however when running on heroku I get the warning.... |
@kand617: because locally your |
Same issue as @chadrien |
@hourliert Not I'm aware of. I'm implementing the server-side rendering on my project. I need and I plan to fix all the issue related to this. Still, if you want to help, that's welcomed 👍. |
I am not really aware of how |
Actually, I'm not sure it's an issue with material-ui. I would see this more like a feature. |
Don't you need to do exactly this for React already? It's a big performance gain and results in a smaller bundle. It's odd to have unisoversal libs depend on |
Hi,
I just wanted to share a feedback I just encountered using material-ui.
When using server-side rendering, I had the now famous "React attempted to reuse markup in a container but the checksum was invalid" error, the diff being the following:
After some research, I found the source of the error: https://github.com/callemall/material-ui/blob/ae6147ca75dbe4b7229ca775bf95c1b0210e0875/src/utils/styles.js#L18-L25
Thing is, the server is running on production mode, so it doesn't go in the if, therefore don't add the
did-filp:true
to the element's styles, but client-side, as the variable is undefined, I go into the if and thedid-flip:true
is added, thus the mismatch.I use webpack and have been able to use the following trick:
As material-ui/react is also something client-side, maybe the use of
process
should be avoided, isn't it?Hope this can at least help others in my situation.
The text was updated successfully, but these errors were encountered: