Skip to content
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

isReactive/reactive doesn't work in SSR (regression in beta 14) #537

Closed
danielroe opened this issue Sep 22, 2020 · 2 comments · Fixed by #546
Closed

isReactive/reactive doesn't work in SSR (regression in beta 14) #537

danielroe opened this issue Sep 22, 2020 · 2 comments · Fixed by #546
Assignees
Labels
bug Something isn't working

Comments

@danielroe
Copy link
Member

reactive doesn't work on SSR. In a vanilla Nuxt project using just @vue/composition-api, isReactive(reactive({})) prints false on server-side but true on client-side.

Reproduction: https://codesandbox.io/s/sweet-dubinsky-ilbt1?file=/pages/index.vue

Linked issue: nuxt-community/composition-api#244

@pikax pikax added the bug Something isn't working label Sep 23, 2020
@antfu
Copy link
Member

antfu commented Sep 29, 2020

Did some rough research, this probably becomes the obj return by observe function does not contain the __ob__ attribute. The newly introduced getRegisteredVueOrDefault imports vue by using require, I guess it might be the wrong build for SSR. Vue.observable({}) does not ship with __ob__ attribute in SSR.

I am not familiar with SSR, if someone has any idea of this, please let us know. Thanks.

Simplified problem source reproduce:
https://codesandbox.io/s/vue-observable-ssr-cjmpm?file=/pages/index.vue

@antfu antfu self-assigned this Oct 1, 2020
@antfu
Copy link
Member

antfu commented Oct 1, 2020

Found a workaround in #546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants