-
Notifications
You must be signed in to change notification settings - Fork 30
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
Flash of unstyled content when loading from server #75
Comments
You can clone this repo https://github.com/elastic/next-eui-starter Change some components to test this issue. |
Hi @h0wardch3ng, Can you try to replicate the issue with a CodeSandbox?
The next-eui-starter is currently using
So is this issue happening after v63.0.0? I'm a bit confused. A CodesandBox would be helpful. |
@miukimiu https://github.com/h0wardch3ng/eui-rendering-issue
You can use this to test this bug, thanks |
Pinging @chandlerprall on this one as a perf/rerender expert :) |
Thanks @constancecchen @miukimiu EUI versions higher than v63.0.0 all have this rendering problem. |
I've been able to reproduce (more or less) the devtools screenshot in both the eui-rendering-issue and next-eui-starter repos. I believe the styled->unstyled->styled changes is an artifact of running the performance audit starting with the existing (styled) page, reloading, and applying styles. I tested this two ways:
This leads me to think the root issue is around next+emotion+server-side-rendering. That is supposed to Just Work out of the box since Emotion v10 but I bet EUI's custom emotion cache targets is interfering. @h0wardch3ng if this sounds accurate to you, I will move this issue over to the next-eui-starter repo. |
@chandlerprall |
What is the Solution to Problem? |
Bump :-) |
To fix this Problem Please run following Command and there will not be flashes of unstyled content
|
@Chetan11-dev What happened to the forked repository that supposedly fixed the issue? The repo appears to gone and your comment edited to specify using 63.0.0 to fix the problem. The fact that we're stuck on 63.0.0 is the problem. |
The fork also just changes the elastic ui version to 63. |
Agree, thank you. |
Ahh I see your intention now. In terms of going from a fresh clone of this repo to a working version, yes I agree that's an easier solution than a fork. But I think at this point a lot of us are already on 63.0.0 (as mentioned in the OP) and are hoping for a solution for upgrading past that. EUI is currently on version 88.3.0 and we're getting left behind. |
We plan to update next-eui-starter to the latest Next.js and EUI versions within the next few weeks and provide a fix for the flash of unstyled text bug. The bug is caused by EUI's Emotion styles not being properly extracted and injected into the document's For anyone looking for an immediate solution, I recommend following the code in https://github.com/haukurmar/next-13-appdir-with-emotion/tree/master repository and passing the custom |
What's the update on this guys? Really looking forward to this cause next 14 is becoming more stable than ever |
When the page is opened, the page layout is normal, why the page is re-rendered once again.
EUI v63.0.0 is normal, All new versions have this problem.
The text was updated successfully, but these errors were encountered: