lwc icon indicating copy to clipboard operation
lwc copied to clipboard

Hydration does not create custom elements

Open nolanlawson opened this issue 2 years ago • 1 comments

In a normal CSR (Client-Side Rendered) LWC scenario, we create custom elements (demo). So if you render <x-app> and then do:

customElements.get('x-app')

... this will return an actual LWC element constructor.

Screen Shot 2022-08-22 at 3 39 14 PM

In SSR+hydration, however, we don't create custom elements (demo).

So customElements.get('x-app') returns undefined:

Screen Shot 2022-08-22 at 3 38 12 PM

SSR+hydration should (ideally) result in the same thing as a pure CSR app. So hydration should result in custom elements being defined.

nolanlawson avatar Aug 22 '22 22:08 nolanlawson

This issue has been linked to a new work item: W-11634909

git2gus[bot] avatar Aug 22 '22 22:08 git2gus[bot]

Fixed by https://github.com/salesforce/lwc/pull/3802 although we need a follow-up PR for lifecycle events.

nolanlawson avatar Oct 19 '23 19:10 nolanlawson