-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@astrojs/lit Hydration Fails #8887
Comments
Sorry for the late response. It works because the client:load one is hydrating the server only. Try to comment the client:only and you will see it's not working. Please reopen. |
@lilnasy I'm genuinely disheartened and somewhat disillusioned by your response and the manner in which you've interacted with me. I had hoped to address an issue, but it seems there's been a misunderstanding. Kindly take note of the distinction: The firs element is intended to be rendered on the server and hydrated on the client while the second is meant for client-side loading. The functionality of the first component is contingent solely on the presence of the second. Now, observe the image below. This isn't functioning as the second element is absent, thus causing the issue. It appears there is an issue with the lit integration, particularly with the lit-labs/ssr module. |
Is it expected that hydration take place in the second case? |
Sure, the first component is expected to be hydrated on the client. What would be the reason to render a component that is not hydrated hence not working? |
By default, a UI Framework component is not hydrated in the client. If no client:* directive is provided, its HTML is rendered onto the page without JavaScript. |
@lilnasy thanks for your answer, I was probably missing the point that the directive was needed. I thought it will be loaded automatically by default once rendered and that the hydration would have been handled directly by lit-lab/ssr. I'm genuinely thankful for your explanation. I hope this ticket can helps somebody doing my same error in the future. |
Thanks! That's a good point. I am linking relevant docs for those who find this thread. https://docs.astro.build/en/core-concepts/framework-components/#hydrating-interactive-components |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Describe the Bug
Hydration do not occur.
Please note that if the component is loaded using the directive client:only="lit" it works correctly.
Looks like an issue with lit/ssr.
I'm worried it could be related with this:
#8825
What's the expected result?
Hydration should work
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-fqvkdx-cut6vb?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: