-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
App-vite SSR does not inject the styles at initial render in development #12803
Comments
Hi @Evertvdw! 👋 It looks like you provided an invalid or unsupported reproduction URL. Without a proper reproduction, your issue will have to get closed. Thank you for your collaboration. 👏 |
This is a limitation of dev SSR. We cannot inject the styles because we'd need to continuous build the whole project in order to extract the critical css paths, which would defeat the whole purpose of having a very fast dev DX. |
It seems they fixed this at nuxt side, in this PR nuxt/vite#195. I dont really get what they are doing there but maybe we can do something similar or approach them how/if they fixed this? |
They might be doing what I said above (building and rebuilding), otherwise I currently see no option other than keep on rebuilding the whole project --- which would essentially work like the webpack variant (NOT what we want). I could build the project only once and at startup but then whatever changes are done to the styles (like adding new style files) will not be picked up. In any case, will investigate in the following days. |
@rstoenescu |
@rstoenescu Or if not in Quasar generically is there a way we can implement this for ourselves using SSR middleware or something like that? |
What happened?
The first HTML send to the client with SSR does not contain
style
tags, which causes a flash of unstyled content. This is related to vitejs/vite#2282 and vitejs/vite#2013. I think there are workarounds possible but I think those should be handled by Quasar internally.This only happens when in development but that leads to a very bad developer experience, because you then have to assume it will only happen on development.
What did you expect to happen?
Styles should be present at first load
Reproduction URL
Repro based on project starter
How to reproduce?
Ctrl + u
to see that there are indeed nostyle
tags presentFlavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), SSR Mode
Platforms/Browsers
No response
Quasar info output
Relevant log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: