Open JoshiiSinfield opened 3 years ago
Could you send the full call stack in the developer tool?
Hi @imcvampire ,
Thanks. here it is:
TypeError: Cannot read property 'type' of undefined
at Proxy.i (webpack-internal:///./node_modules/vue-image-lightbox/dist/vue-image-lightbox.min.js:2)
at VueComponent.Vue._render (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3542)
at VueComponent.updateComponent (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:4049)
at Watcher.get (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:4473)
at new Watcher (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:4462)
at mountComponent (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:4067)
at VueComponent.Vue.$mount (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:8405)
at init (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:3115)
at createComponent (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:5968)
at createElm (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:5915)
_callee$ @ client.js?06a0:97
The vue-image-lightbox
is minified :-( Could you provide a simple reproduction?
HI @imcvampire ,
I've provided the file to recreate it in the opening comment.
If you create a new demo nuxt app, add that template and run it up it'll work.. I can do it & deploy somewhere if necessary?
Cheers, Josh
The file in the opening cmt seems wrong because you haven't imported vue-image-lightbox
?
Apologies @imcvampire I forgot to mention that I install it as a global component:
plugins/vue-image-lightbox.js
import Vue from 'vue'
import VueLazyLoad from 'vue-lazyload'
import LightBox from 'vue-image-lightbox'
require('vue-image-lightbox/dist/vue-image-lightbox.min.css')
Vue.use(VueLazyLoad)
Vue.component('light-box', LightBox)
then i add it to plugins array within nuxt.config.js using:
{ src: '~/plugins/vue-image-lightbox.js', ssr: false },
Do you use vue 2 or vue 3?
I have same error, finally I found this happened when media
is empty array.
so i add v-if="imagelist.length > 0"
, fixed the error.
Hi @imcvampire, is this supported in Vue 3?
@ziyyaad-anthoziy I think it should
vue-image-lightbox.min.js?5dec:2 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_c') at Proxy.i (vue-image-lightbox.min.js?5dec:2:1) at renderComponentRoot (runtime-core.esm-bundler.js?d2dd:890:1) at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?d2dd:5602:1) at ReactiveEffect.run (reactivity.esm-bundler.js?89dc:185:1) at instance.update (runtime-core.esm-bundler.js?d2dd:5716:1) at setupRenderEffect (runtime-core.esm-bundler.js?d2dd:5730:1) at mountComponent (runtime-core.esm-bundler.js?d2dd:5512:1) at processComponent (runtime-core.esm-bundler.js?d2dd:5470:1) at patch (runtime-core.esm-bundler.js?d2dd:5060:1) at mountChildren (runtime-core.esm-bundler.js?d2dd:5256:1)
Ran into this error and based on the Stackoverflow post below thought it was not supported
I'm using this project with Nuxt.
Upon component mounting my array of media is empty. I'm then populating it in the fetch method (i've tried beforeMount & mounted too).
Because the array is empty when mounting I'm getting "Cannot read property 'type' of undefined"
Nuxt/Vue file to recreate:
Any help would be much appreciated.
Cheers, Josh