mobx-vue icon indicating copy to clipboard operation
mobx-vue copied to clipboard

I got error when I use @Observer before @Component with Nuxtjs

Open Him-2C opened this issue 5 years ago • 4 comments

I use Nuxt + typescript and run with 'universal' mode.

I got error when I refresh browser with this code

@Observer
@Component()
export default class Home extends Vue {
  mounted () {
  }
}

Is don't have any error when I try with

export default observer({
  mounted () {
  }
});

error TypeError: Cannot convert undefined or null to object at Function.getOwnPropertyNames () at Home.Component._init (vendors.app.js:2672) at Home.Vue (commons.app.js:16802) at new Home (inspire.js:64) at collectDataFromConstructor (vendors.app.js:2692) at data (vendors.app.js:2767) at collectData (inspire.js:28) at VueComponent.data (inspire.js:111) at VueComponent.Component.options.data (app.js:3171) at getData (commons.app.js:16467)

Him-2C avatar Aug 28 '19 13:08 Him-2C

Could u pls provide a minimum reproduction with codesandbox?

kuitos avatar Aug 28 '19 13:08 kuitos

https://codesandbox.io/s/github/Him-2C/nuxt-typescript-check-mobx

@kuitos

In page/index.vue

Him-2C avatar Aug 28 '19 14:08 Him-2C

https://github.com/Him-2C/nuxt-typescript-check-mobx

Him-2C avatar Aug 29 '19 15:08 Him-2C

solved with

image

Him-2C avatar Sep 29 '19 10:09 Him-2C