Flash of unstyled content in generated page when using scss nuxt 3.0.0-rc.12
See original GitHub issueEnvironment
package.json
{
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "HOST=0.0.0.0 nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"nuxt": "3.0.0-rc.12",
"sass": "^1.55.0"
}
}
nuxt.config.ts
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
css: ['@/main.scss'],
experimental: {
// Temporary workaround for stackblitz
writeEarlyHints: false,
},
});
Reproduction
StackBlitz minimal reproduction link https://stackblitz.com/edit/github-hywqdd?file=app.vue
Describe the bug
At reload time it shows unstyled pages. But in the dev server, it seems fine. It only appears when I generate the project with
npm run generate
and serve with npm run preview
Additional context
In my project, this problem doesn’t appear until nuxt3 rc-11.0.0. It only starts appearing after updating my project to nuxt3 rc-12.0.0
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Understand the Flash of Unstyled Content in Nuxt - Egghead.io
You'll notice soon after working with Nuxt that you'll begin to see your styles flash in during each page load. This is due...
Read more >Eliminate flash of unstyled content - css - Stack Overflow
The problem with using a css style to initially hide some page elements, and then using javascript to change the style back to...
Read more >Recipe - Releases
feat: Use React 18's useId hook for unique IDs if present, ... Fixed flash of unstyled content on the doc-site caused by incorrect...
Read more >Changelog | Docs - TinyMCE
The autolink plugin incorrectly created nested links in some cases. ... Flash of unstyled content while loading the editor because the content CSS...
Read more >Configuration - Nuxt
Nuxt lets you define the CSS files/modules/libraries you want to set globally (included in every page). In case you want to use sass...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is a regression of the inline styles implementation and you can work around it by setting
experimental.inlineSSRStyles
tofalse
.@kwright02 Some info here.
Basically, start with your project and remove as much as you can until the problem can’t be reproduced. 🙏
I have a fix for this issue in progress but want to make sure it also solves your situation.