-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
FOUC after Nuxt 3.10.2 update #25806
Comments
I've noticed that this occurs on Windows and not Linux, with external and not inline styles, in dev and not in prod. Maybe this is related to Vite. |
The solution to me was to downgrade {
"overrides": {
"vite": "5.0.12"
},
"resolutions": {
"vite": "5.0.12"
}
} |
Yes, this is a vite issue. It will be resolved with vitejs/vite#15919 |
This should be fixed in vite@5.1.3. Thanks for the help debugging this regression @danielroe! ❤️ |
Hey @patak-dev just curious what the best way to pull in the latest vite changes into a Nuxt project is? Simply by just installing vite, or will this be added to the next release of Nuxt? Sorry, I'm unfamiliar with using vite in my projects as a direct dependency.. I regenerated my |
Environment
Reproduction
I haven't been able to reproduce it in Stackblitz, but the following steps should work:
Create a new project
Create the following file
assets/css/main.css
:Change
app.vue
:Add the file to
nuxt.config.ts
:Start the dev server and refresh the page multiple times:
You will notice that there's FOUC in the body styles. It is much more prominent when there are multiple styles applied, or a tool like Tailwindcss is used.
If you fix the Nuxt version to
3.10.1
with the following change inpackage.json
it works correctly:Describe the bug
FOUC for global css styles passed to
nuxt.config.ts
.Additional context
I haven't been able to pinpoint the commit that causes this issue, but looking at the release notes of Nuxt 3.10.2 it might be related to the following PR:
Logs
No response
The text was updated successfully, but these errors were encountered: