Nuxt.js: [FOUC] Imported CSS in page not included during ssr

Created on 5 May 2020  路  8Comments  路  Source: nuxt/nuxt.js

Version

v2.12.2

Reproduction link

https://github.com/lights0123/nuxt-css-issue

Steps to reproduce

When we import some css directly in script, or js files from a page, the css will not be included in the server side rendered head.

It will only be injected at runtime.

It's the same with the extractCss property, the extracted css files are not included via link balises.

Surprisingly, it works well in layout!

We can see that well with generate build and by disabling javascript on the page.

What is expected ?

The included CSS, assets/test.css, should be inlined into the page as a