-
-
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
duplicated mui styles in SSR #78
Comments
Hi @bdew, I will have a look at it. You can run the project with: git clone https://github.com/garronej/tss-react
cd tss-react
yarn
yarn build
yarn start_ssr It would be great if you could tell me if you witness the issues you are describing. |
At fist sight our setup seems ok to me, I have to look in deeper details. Just, if I may, I think you can remove this file and use Or if you want to keep |
Can you test if you experience the same issue with React 18 🙏🏻 |
Thanks for the hint about makeStyles - i didn't see that there's a default version for it. I'm already using React 18... I think? At least that's what my package.json says |
Yes but can you downgrade to react 17 and see if it works. Maybe I need to work on the React 18 compat. |
I tried with React 17 and I don't see the issue there, so it seems to be only with 18 And by the way your start_ssr doesn't work on windows
|
Also something interesting I noticed - when running next in developent mode (with react 18) it only happens on the very first render of the page. After that, even with JS disabled it doesn't happen when refreshing the page until you restart the whole process. |
Okay, thank you for your investigation. It seams there is some work to do to support React 18. |
I can reproduce |
I opened an issue on the emotion repo: emotion-js/emotion#2725 |
The issue is not restricted to |
Hi, |
I'm running into a weird issue on a site using next.js with MUI 5 with tss-react.
Somehow all MUI styles end up duplicated in the initial server render of the page. If I disable JS and look at one of the elements I see something like this
Note how it shows .mui-171h0ym then .tss-a983qb-title then .mui-171h0ym again (which ends up overriding my custom style)
When the page hydrates it fixes it so the problem is only visible for a moment (or if you disable JS)
You can see the site at https://sqp.bdew.net/ and the code for it here https://github.com/bdew/sqp
The text was updated successfully, but these errors were encountered: