RobinCK / vue-gallery

:camera: Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. πŸ‡ΊπŸ‡¦
https://robinck.github.io/vue-gallery/
MIT License
470 stars 85 forks source link

Maximum call stack size exceeded #18

Closed FabianEllenberger closed 6 years ago

FabianEllenberger commented 6 years ago

Tried to implement vue-gellery into my nuxt.js app and got the Maximum call stack size exceeded error. I'm using it as a plugin as mentioned here https://github.com/RobinCK/vue-gallery/issues/3 and have the basic options as shown in the readme. Did any of you had the same error or knows what I'm could be doing wrong here (code below)? Thanks! πŸ™πŸ»

<script>

export default {
  name: 'Gallery',
  data: () => ({
    index: null,
    images: [
      'https://dummyimage.com/800/ffffff/000000',
      'https://dummyimage.com/1600/ffffff/000000',
      'https://dummyimage.com/1280/000000/ffffff',
      'https://dummyimage.com/400/000000/ffffff'
    ]
  })
}
</script>

<style src='./Gallery.scss' lang='scss'></style>

<template>
  <div class="Gallery">
    <gallery :images="images" :index="index" @close="index = null"></gallery>
    <div
      class="Gallery__image"
      v-for="(image, imageIndex) in images"
      :key="imageIndex"
      @click="index = imageIndex"
      :style="{ backgroundImage: 'url(' + image + ')', width: '300px', height: '200px' }">
    </div>
  </div>
</template>
RobinCK commented 6 years ago

Sorry, but I did not work with nuxt.js Maybe the guys will prompt @rlam3 @lomholdt Just advise to see: https://github.com/RobinCK/vue-gallery/pull/7

lomholdt commented 6 years ago

It seems weird. It's working perfectly for me. I can't see any problems with the provided code example. Are you sure the problem comes from vue-gallery?

FabianEllenberger commented 6 years ago

@lomholdt that was what i was thinking aswell, but as soon as i add the component <gallery> even with or without any props the error occurs. I'll keep on investigating and will write my update here if i figured something out

FabianEllenberger commented 6 years ago

It was happening due to another rendering error from vue/nuxt which i haven't figured out yet. But using the gallery at any other point in my app works totally fine.

Update: Seems like the problem had to do with namings. I named a component Gallery with a capital "G" wich used the vue-gallery component as gallery with a small "g" which caused it to load itself infinitely.

RobinCK commented 6 years ago

Thanks

Jones-S commented 6 years ago

@FabianEllenberger Just drove mit insane... Same error