Skip to content

bug: Nuxt invalid slot management with the SSR capability #632

Open
@mamillastre

Description

@mamillastre

Prerequisites

Stencil Version

4.27.2

Stencil Framework Output Target

Vue

Stencil Framework Output Target Version

0.9.6

Current Behavior

On Nuxt (3.16.0), we use a Stencil component with 3 slots (default, header, footer).

<MyComponent>
    <span slot="footer">Footer</span>
    Content
    <span slot="header">Header</span>
</MyComponent>

Here the rendering by the server:
Image

And after the client hydration:
Image

The slots are duplicated and not rendered has expected.

Expected Behavior

The slot are rendered has expected during SSR and hydration.
For example, here is the rendering on a Next app:

Image

You can run the Next app on the reproduction repo by runing the npm run nextcommand (instead of npm run nuxt).

Steps to Reproduce

I fork the designsystem-boilerplaterepo to reproduce the bug:

  • Clone the below "Code reproduction URL"
  • In the root of the project:
  • npm i -ws
  • npm run nuxt

Code Reproduction URL

https://github.com/mamillastre/stencil-code-reproduction

Additional Information

The client side rendering seems to work just fine except it does not clean the content rendered by the server.
On the server side, the rendering do not work has expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanteda good issue for the communitytype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions