How to Prevent Flash of Incorrect Theme (FOUC) in SSR with Vike? #2312
|
I'm using Vike with SSR and experiencing a flash of the wrong theme before the correct one is applied. How can I ensure the theme is applied correctly on the first render to avoid this flash? Thanks! |
Answered by
brillout
Apr 5, 2025
Replies: 1 comment 13 replies
|
Seems to be more of a user-land question than a Vike related one? |
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an example of defining a
<script>tag inside.vuefiles: https://github.com/vikejs/vike-vue/blob/fed2f473e2eb1c33ea1943908737dd8bb1047359/examples/full/pages/images/Image.vueIs that the only workaround?
I'm more than open to implement
+scriptbut let's first do a thorough research on what workarounds there is around defining<script>tags inside.vuefiles. Up for the task?Can you publish a minimal reproduction? In the example above, using
useConfig()works just fine.