question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flash of unstyled content (FOUC) with Nuxt 3、Vite

See original GitHub issue

Environment

  • Operating System: Darwin
  • Node Version: v14.16.1
  • Nuxt Version: 3.0.0-27303148.ac98373
  • Package Manager: yarn@1.22.5
  • Bundler: Vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Mini Repo : https://github.com/webfansplz/nuxt3-fouc-repo/tree/main

Describe the bug

After building it with yarn build (nuxt build) and starting the server with yarn start (node .output/server/index.mjs) we still get a flash of unstyled content on load.

This problem also existed in develop mode .

The FOUC leads to very annoying developer experience and user experience . 💔

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
webfansplzcommented, Nov 30, 2021

I have the same preset as author and I got flashing effect on my main page. I added in nuxt.config.ts

build: {
    extractCSS: true
}

and the effect gone. Did I make it right way? 🤷🏻

This is only applied in webpack.

Read more comments on GitHub >

github_iconTop 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 >
How to prevent this jump when you refresh a page or load for ...
Nuxt is a JavaScript framework for creating Universal Vue.js Applications. ... It's called FOUC (flash of unstyled content) ... 3 days ago.
Read more >
@graphiteds/core - npm
We offer Vue 3 wrappers on top of @graphiteds/core components for optimal DX (typings, v-model support, out of the box tree-shaking, etc.).
Read more >
Nuxt 3 integration - Vue I18n - Intlify
The bundler for Nuxt 3 is vite by default. So we will use the vite option here for optimization. In vite.plugins , the...
Read more >
Components usage - Graphite Design System
Optional CSS to prevent Flash Of Unstyled Content (FOUC) because of the ... We offer Vue 3 wrappers on top of @graphiteds/core components...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found