nuxt
nuxt copied to clipboard
Styling of Regular Component Lost in Production When Nested Inside Global Server Component
Environment
- Operating System: Linux
- Node Version: v20.9.0
- Nuxt Version: 3.9.3
- CLI Version: 3.10.0
- Nitro Version: 2.8.1
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, experimental, modules, srcDir
- Runtime Modules: @nuxtjs/[email protected]
- Build Modules: -
Reproduction
https://stackblitz.com/edit/github-rkhot3?file=README.md
Describe the bug
Component Setup:
- Component A: This is a global server component (A.server.global.vue)
- Component B: A regular component with specific scoped styling. (B.vue)
Behavior Observed:
- In development mode (
nuxt dev
), everything works as expected. component B's styling is correctly applied when it is used inside component A. - In production mode (
npm run build && node .output/server/index.mjs
), the styling of component B is not applied when it is used inside component A.
I provided a stackblitz reproduction link, but that starts directly in dev mode, and as I said above everything works in dev mode, the stackblitz needs to be started in production mode.
Additional context
No response
Logs
No response
Hi :wave: is it reproductible with a non global server component ? If so, this may be a duplicate of https://github.com/nuxt/nuxt/issues/24480
Hi @huang-julien, thanks for checking, you are right, it is reproductible with a non global server component, but please note that for me this only happens in production build not in dev mode.
I may not have an in-depth understanding of every aspect, but I will make an effort to respond to all requests for additional information.
Does my test repository replicate the same issue presented here, or should I create a new issue for it?
Repo: https://github.com/imnaK/nuxt-minimal-starter
Bug in short: My style ref will not be applied on a scroll listener on production/preview server. It will work as expected if I switch pages or on dev server.
resolved in https://github.com/nuxt/nuxt/pull/25455