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
Meta set on server side gets lost on client side #140
Comments
Thanks @jgupta Thanks for linking that discussion, this is a planned feature before the stable v1 release. I've put further notes in the linked discussion. |
we have a use case where any script tag is duplicated on client hydration when its already been rendered on the server |
Hi, Sometimes metas (injected inline css in head + title + other stuff) is renderend on server site ( i test this by only regarding source code of the page or deaktivating js on browser) and sometimes it is not. it has something to to with the fetch request. And the client side removes title tag after it was rendered on the server side. but this should hopefully be fixed with the next rc version i guess. This is my code:
When i remove
from page the client removes title tag. My main problem is the html i get from the server. In my real project i do not use the fake api. locally everything works fine. But in production mode the hmtl from the server is sometimes buggy. This does not concern the data in the template but the data i use in useHead() or in template tags. The object i try to create from dynamic data is always rendered correct - but the assignment to useHead (or directly injected in template via ) is not working. It seems to be a race condition between useHead / template tags and the $fetch composable in nuxt3. Has anyone observed anything similar? What would be the best way to get always correct rendered head html from server? |
This is now supported in v1. @Milenoi, please try the latest v1, you may have more success. If you're still stuck please open up a new issue :) |
@harlan-zw Using rc13 solved all my problems. all metas + head content is correctly rendered now in html on server side. thank you very much! |
Discussion: https://github.com/nuxt/framework/discussions/7785
If meta is set during SSR, client side should not manipulate it for performance reasons. At present, client side deletes the meta already set by SSR and recreates it.
We were hoping it to be fixed with Nuxt RC12 nuxt/framework#8000 but it is not. Tested on edge after this PR got merged.
The text was updated successfully, but these errors were encountered: