You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open up the browser's dev tools and go to the console panel
Filter the console message with "NUXT-SSR"
Reload the preview in StackBlitz
What is expected?
The custom element should be rendered with the prop "name" set to "John Doe" on both the server and the client
What is actually happening?
The custom element is rendered with the prop "name" set to "John Doe" on the server.
The custom element is rendered with the prop "name" set to "default" on the client.
A Nuxt3 module is being worked on that is server-side rendering Lit components using @lit-labs/ssr package. The server rendering of these custom elements built on Lit work well. But during hydration on the client side, the custom elements are not created with the right props. Which results in Lit hydration issues mentioned here.
If we are able to determine whether a given node is a custom element in this if statement here and patch the node, then it works extremely well.
However, trying to debug this we have found that the isCustomElement function from the app config is not available.
As a work-around, we could check customElements.get(el.localName) to see if it's in the custom elements registry (which is safe at this is client-side only)
Vue version
3.2.45
Link to minimal reproduction
https://stackblitz.com/edit/nuxt-starter-b3q2qu
Steps to reproduce
What is expected?
The custom element should be rendered with the prop "name" set to "John Doe" on both the server and the client
What is actually happening?
The custom element is rendered with the prop "name" set to "John Doe" on the server.
The custom element is rendered with the prop "name" set to "default" on the client.
System Info
Any additional comments?
A Nuxt3 module is being worked on that is server-side rendering Lit components using @lit-labs/ssr package. The server rendering of these custom elements built on Lit work well. But during hydration on the client side, the custom elements are not created with the right props. Which results in Lit hydration issues mentioned here.
This seems to happen because, during hydration, the props are not applied/patched to the components. Except for the props that are named
value
and those that start withon
.It feels like custom element props should also be applied during hydration. Otherwise, they get instantiated with the wrong data on the client side.
The text was updated successfully, but these errors were encountered: