alexjoverm / v-runtime-template

Vue component for compiling templates on the fly using a v-html like API
MIT License
605 stars 70 forks source link

TypeError: Cannot read property 'asyncComputed' of undefined #14

Closed naive17 closed 5 years ago

naive17 commented 5 years ago

i get

TypeError: Cannot read property 'asyncComputed' of undefined
    at Object.vueAsyncComputedInjectedDataFn [as data] (app.js:94221)
    at getKeysFromOptions (app.js:85826)
    at Proxy.render (app.js:85864)
    at VueComponent.Vue._render (app.js:105150)
    at VueComponent.updateComponent (app.js:103394)
    at Watcher.get (app.js:103748)
    at new Watcher (app.js:103737)
    at mountComponent (app.js:103401)
    at VueComponent../node_modules/vue/dist/vue.esm.js.Vue.$mount (app.js:109146)
    at VueComponent../node_modules/vue/dist/vue.esm.js.Vue.$mount (app.js:111545)

Every time i render something

DelfsEngineering commented 5 years ago

I've gotten this too, it seems to be related to the spread operator in the getKeysFromOptions as it enumerates the keys? I don't see it in all instances, so its dependent on the component its called from. I don't have a solution.

davek1979 commented 5 years ago

Got this problem too, does anyone know a solution?

naive17 commented 5 years ago

I don't remember well but as far as i remember you must import vue-async-computed from npm just before vue-runtime-template.

davek1979 commented 5 years ago

Hmm in my case I had to disable vue-async-computed competely to get it to work. Thank you for your reply.

H3xx3n commented 5 years ago

Had this issue today. It seems that when the parent component has any asyncComputed and the child component has no data, vue messes up. Quick fix is to always have data() {return {}} in the child components or set them as functional image

iSnow commented 5 years ago

Had this as well, for me this commit in a fork fixed it:

https://github.com/Duncank/v-runtime-template/commit/567dd1a9b3c04f5d39996cfb766c9ee9412a0471

alexjoverm commented 5 years ago

Fixed on 1.7.1 6289c88c6812df2037f3e138e35fad75c4fd71cc