Closed innocenzi closed 2 years ago
Hi Enzo!
Firefox has the weirdest bugs. Amazing that a bug like this has been open for four years.
The best place to inject the workaround script tag would be ssg.beforePageRender, right before the page is written to a file.
I'll take a deeper look later, perhaps we can add the workaround in รฎles like last time. Feel free to open a PR!
Yup, Firefox is weird. Thanks for the hook, I successfully implemented the workaround for now! :)
Closing for now, users can workaround this Firefox issue by injecting <script>0</script>
using ssg.beforePageRender.
The FOUC will only happen in Firefox when both of the following conditions are met:
We could add the workaround to iles by default, but perhaps it's better to wait until this issue is fixed in Firefox.
I agree that a workaround is not needed in Iles directly, however I think it could be documented in a troubleshooting section, as the problem is quite weird.
Would you like me to PR?
That would be great, thanks!
iles
andvite
.Description ๐
There is a bug in Firefox which causes a flash of unstyled content by displaying the markup, then the CSS.
A workaround is to add
<script>0</script>
right after<body>
.Is there a way to hook into the page generation process to add this workaround?
Reproduction ๐
Screenshots ๐ท
On Firefox:
On Chrome: