-
Notifications
You must be signed in to change notification settings - Fork 80
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
"Cannot read property 'type' of undefined" error when media array is empty #118
Comments
Could you send the full call stack in the developer tool? |
Hi @imcvampire , Thanks. here it is:
|
The |
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, |
The file in the opening cmt seems wrong because you haven't imported |
Apologies @imcvampire 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 |
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') 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
The text was updated successfully, but these errors were encountered: