https://github.com/lights0123/nuxt-css-issue
yarn && yarn run generate
Then view dist/index.html, such as via npx serve dist
The included CSS, assets/test.css, should be inlined into the page as a <style> element when generated into a static page, instead of being added by JS later.
Only CSS defined in a local <style> element is inlined. If Javascript is disabled, then this CSS never gets loaded, as it requires JS to include in the page. As per https://nuxtjs.org/faq/css-flash,
the CSS is separated and put in the header so this flash of unstyled content does not appear anymore
However, repeating this in a layout (i.e. putting import '~/assets/test.css'; in layouts/default.vue) works successfully, and the CSS is included in the generated HTML file.
I remember this working fine a few months ago in a project I was working on. I changed a few things around, though, and this bug appeared.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
This issue still exists in Nuxt 2.11.0.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
Have the same problem...
I have this problem!! please help
I have the same problem!