You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using pinia store in SSR (nuxts) and try to persist data to cookie with the $subscribe method of pinia store.
But the callback never runs even specify { flush: 'sync' }.
So I always get empty cookie.
After a bit of trace,
I found the $subscribe use watch to achieve the update notifying
And vue ignored watch (even 'sync', which is completely unrelated to component live cycle) in ssr mode.
The text was updated successfully, but these errors were encountered:
Vue version
3.2.36
Link to minimal reproduction
https://codesandbox.io/s/vue-ssr-watch-sync-bug-xr5jql?file=/src/App.vue:115-356
Steps to reproduce
Make setup function does things as such
And run it in the ssr server environment
What is expected?
Both server returned result and client rendering should returns 1 because everything happened before returning from
setup ()
.Watch with
flush: 'sync'
should be respected as it don't use component live cycleWhat is actually happening?
The server html returns 0.
Watch on ssr is ignored unconditionally
System Info
Any additional comments?
Context:
I am using pinia store in SSR (nuxts) and try to persist data to cookie with the
$subscribe
method of pinia store.But the callback never runs even specify
{ flush: 'sync' }
.So I always get empty cookie.
After a bit of trace,
I found the
$subscribe
usewatch
to achieve the update notifyingAnd vue ignored watch (even 'sync', which is completely unrelated to component live cycle) in ssr mode.
The text was updated successfully, but these errors were encountered: