Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style sheets are not included on the server side during production builds #25690

Closed
kominov opened this issue Feb 8, 2024 · 4 comments
Closed

Comments

@kominov
Copy link

kominov commented Feb 8, 2024

Environment

  • Operating System: Linux
  • Node Version: v20.8.0
  • Nuxt Version: 3.10.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@10.1.0
  • Builder: -
  • User Config: app, debug, sourcemap, router, runtimeConfig, build, experimental, vite, typescript, css, modules, devtools, plugins, image, viewport, BASE_API_URL
  • Runtime Modules: @nuxt/image@1.3.0, @nuxtjs/partytown@1.4.0, @vueuse/nuxt@10.7.2, nuxt-jsonld@2.0.8, nuxt-viewport@2.1.4, sitis-nuxt-3/dist
  • Build Modules: -

Reproduction

Describe the bug

Stylesheets are not included on the backend during production builds if the project uses layouts. If the contents of layouts are transferred to app.vue everything works as expected. The problem appeared since version 3.10
This is the content of app.vue

image

This is the content of layouts

image

Additional context

No response

Logs

No response

Copy link
Contributor

github-actions bot commented Feb 8, 2024

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
👉 https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

@kominov
Copy link
Author

kominov commented Feb 8, 2024

Unfortunately, I can’t reproduce this error on a new project, but I noticed this oddity. If I remove all the scss code from the style tag in layout, then everything starts working correctly, but if I add at least one class there, then default.css stops being generated in the production build.
it's with scss in layout
image
image
it's without scss
image

@MickL
Copy link

MickL commented Feb 12, 2024

Possibly because of this: #25724

Can you check if after build the folder .nuxt/dist/server/_nuxt contains a .vue file that should be a js file with a stylesheet import in it?

@danielroe
Copy link
Member

resolved in #25764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants