Skip to content

@lit-labs/ssr - Property binding server side? #4406

Discussion options

You must be logged in to vote

Hi! Thank you for asking this question. It definitely highlights a lack of good errors when hitting painful cases in Lit SSR.
I've attached to this comment the changes required to fix the issues you are seeing (found at the end).

Issue 1: Your client side elements load too fast

<script src='/dist/bundle.js'></script> is located at the top of the HTML file, which blocks the HTML parser to fetch and execute your JavaScript. This results in my-list being completely loaded and ready to use before the HTML parser has started to render the body element.

This means that if you have server side rendered my-list, the declarative shadow DOM will have already attached the shadowRoot and an error get…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@AndrewJakubowicz
Comment options

@pedrolzoliveira
Comment options

Answer selected by pedrolzoliveira
Comment options

You must be logged in to vote
1 reply
@pedrolzoliveira
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants