-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
12.1.6 CSS generation regression #36675
Comments
I am also facing the same issue in MUI v5. Screen.Recording.2022-05-05.at.02.30.13.movFOUC in Next v12.1.6 Without FOUC in Next v12.1.5 |
@nghiepit Can you share the actual link to the sandbox which has the issue? From your recording, I see only the link of the app running - https://rnwhn.sse.codesandbox.io which shows the distortion. The other sandboxes you mentioned seem to work. |
@gurkerl83 sorry, I just updated codesanbox. |
The problem is real, somehow it works in 12.1.5 but breaks in 12.1.6. Update: Thx! |
There's definitely a regression in how styles are applied. I've been trying to go through the commits, but haven't found any contenders. Not that I'm intimate with the codebase or have spent more than 5 minutes going through commit names. I'm going to look more into this, but I'm pretty certain it has to do with custom document, and how emotion injects styles/how styles are injected. EDIT: A temporary fix - if you don't use react 18 features - is to downgrade to react 17. This allows usage of the newest next version without FOUC. I've tested in my own application, and the MUI example so far. Apparently, there's a bunch of complex stuff going on with streaming in React 18, and the current performance-oriented implementation of streaming in NextJS, is breaking how rendering works with - at least - Emotion under MUI. Also, it seems the problem is how the cache gets populated during rendering. MUI apparently doesn't support the streaming in React 18. |
So, after trying to read changes in the Next code, I thought the new rendering seemed like it would populate the application with logic from custom document on the first render.
I'm still testing, and have to get home to play around with this some more. |
It should be fixed in |
I still have this distortion issue even after upgrading it to |
@srk-sharingan Could you file a new issue with your reproduction? Thanks |
Version 12.1.7-canary.4 works properly for me |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I'm seeing a CSS generation regression in my setup starting from
12.1.6
and persisting with current12.1.7-canary.1
.I'm using React 18 with emotion based UI kit. I see a huge FOUC that gets resolved a moment after load, see dev lighthouse screenshots:
12.1.5
12.1.6+
Any idea if this is an issue with React 18 or how to mitigate? I locked my packages to 12.1.5 for now.
Expected Behavior
No FOUC like in 12.1.5
To Reproduce
The text was updated successfully, but these errors were encountered: