Skip to content

bug: globalStyles not prepended to SSR rendered components #6639

@kyleMessnerLillyContractor

Description

Prerequisites

Stencil Version

4.43.2

Current Behavior

The global stylesheet does not get appended to the adoptedStyleSheets property of components during SSR.

Expected Behavior

Adopted stylesheets include the global styles for SSR components.

System Info

System: node 22.14.0
    Platform: darwin (25.3.0)
   CPU Model: Apple M4 Pro (12 cpus)
    Compiler: /Users/*****/Sanity/*****/node_modules/.pnpm/@stencil+core@4.43.2/node_modules/@stencil/core/compiler/stencil.js
       Build: 1772184285
     Stencil: 4.43.2 🌙
  TypeScript: 5.8.3
      Rollup: 4.44.0
      Parse5: 7.2.1
      jQuery: 4.0.0-pre
      Terser: 5.37.0

Steps to Reproduce

Create stencil package with global styles
Create stencil component
Output hydrate package & react package
Install next
Add SSR version of stencil component to page
Observe to global styles not being in the adopted stylesheets list

Code Reproduction URL

N/A

Additional Information

I intend to submit a PR to fix this. The fix does not appear to be specific to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions