Composition-api: `isReactive`/`reactive` doesn't work in SSR (regression in beta 14)

Created on 22 Sep 2020  路  2Comments  路  Source: vuejs/composition-api

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: https://github.com/nuxt-community/composition-api/issues/244

bug

All 2 comments

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

Found a workaround in #546

Was this page helpful?
0 / 5 - 0 ratings