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 in generated page when using scss nuxt 3.0.0-rc.12

See original GitHub issue

Environment

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:closed
  • Created a year ago
  • Reactions:5
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
danielroecommented, Oct 20, 2022

This is a regression of the inline styles implementation and you can work around it by setting experimental.inlineSSRStyles to false.

2reactions
danielroecommented, Oct 23, 2022

@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.

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 >
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 >

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