-
Notifications
You must be signed in to change notification settings - Fork 247
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
Updating meta related data just after hydration is ignored #224
Comments
I'm experiencing this as well (I think, could be something else) when trying to set |
Well actually I am not the author of this doc but if you could help me on it @ktsn it would be great. Please mention me so I can receive an email when you answer. |
Same thing for me and the
In my template file,I'm using
|
This seems to be resolved by the fix for issue #283 which just forces vue-meta to run once when the page has loaded |
Closing as changes for this issue are included in the v2 release candidate. Please help us testing the release candidate and report any follow-ups in a new issue |
Looks like vue-meta ignores the update for data that will affect meta info when it is just after SSR hydration.
Example:
In the above example, it is expected that the
meta[name="description"]
has contentupdated
but it actually benot updated yet
.The complete reproduction is here (using Nuxt): https://github.com/ktsn/vue-meta-repro
I briefly looked into the code and seems that the issue is caused by
batchUpdate
- since It delays the actual update to DOM byrequestAnimationFrame
, it accidentaly treats normal data update as SSR hydration phase.Workaround is wrapping the data update with
requestAnimationFrame
so that it will be processed after hydration phase. But it seems a little hacky.I guess this is a bit hard problem to solve 😞 . Maybe we should state about this behavior in the docs?
The text was updated successfully, but these errors were encountered: