vue-slick-carousel icon indicating copy to clipboard operation
vue-slick-carousel copied to clipboard

Cannot read properties of undefined (reading 'prevArrow')

Open ArkoxHub opened this issue 2 years ago • 39 comments

I just installed this component into my project and I have this error when trying to show up the basic example of the main website

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'prevArrow') vue-slick-carousel.umd.js:10810 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'prevArrow')

Any idea whats wrong? I'm using Vue 3

ArkoxHub avatar Sep 23 '21 21:09 ArkoxHub

Me too!!! :(

GuchiRey avatar Sep 30 '21 14:09 GuchiRey

Same issues happened with me too!! :(

Ahmedreda20 avatar Oct 01 '21 17:10 Ahmedreda20

Hello everybody! I have the same issue, I'm using Vue 3 and I would like to know how to resolve it or if it is a compatibility issue with Vue 3.

aaronmorillo7 avatar Oct 02 '21 17:10 aaronmorillo7

M

Hello everybody! I have the same issue, I'm using Vue 3 and I would like to know how to resolve it or if it is a compatibility issue with Vue 3.

Try to use nuxtjs instead of vue 2 or 3 just did that and worked as well

Ahmedreda20 avatar Oct 02 '21 19:10 Ahmedreda20

Same issue here, on vue 3.

smarques avatar Oct 13 '21 10:10 smarques

same issue over here...

shaked007 avatar Oct 16 '21 16:10 shaked007

same issue over here toooooo

ricepower avatar Nov 09 '21 05:11 ricepower

same issue over here toooooo Uncaught (in promise) TypeError: Cannot read properties of null (reading 'type')

fanzhengshao avatar Nov 15 '21 08:11 fanzhengshao

saaame

gijshoppen avatar Nov 25 '21 11:11 gijshoppen

same :( Any1 have solution?

Yubo0826 avatar Nov 29 '21 10:11 Yubo0826

having the same issue as well

thejawadali avatar Nov 30 '21 14:11 thejawadali

same issue

abuzaid-sayyad avatar Dec 04 '21 05:12 abuzaid-sayyad

same for me, i use vuejs 3. anyone have a solution?

Wil-Script avatar Dec 08 '21 10:12 Wil-Script

Same issue with laravel, vue js, inertia js

zarpio avatar Dec 21 '21 19:12 zarpio

Me too, Laravel 8, Jetstream, Inertia, Vue 3

kinger251285 avatar Jan 31 '22 14:01 kinger251285

same issue here...

jonasalberttan avatar Feb 12 '22 03:02 jonasalberttan

same issue here after migrate :(

sebastian-reynoso avatar Feb 14 '22 18:02 sebastian-reynoso

same issue here ...😑 what is the solution to this problem??

ayman-alshantaf avatar Feb 18 '22 08:02 ayman-alshantaf

I don't know if this is related or not, but since I've found a work-around for a similar issue with vue-slick-carousel and nuxt.js v2 here's my 2 cents:

The specific error I was getting was

TypeError: Cannot read properties of undefined (reading 'length')

image

image

I don't know why I wasn't getting it until now and which specific change in my source code started triggering it (I didn't change the lib version for sure, though), but I've been getting this error every time I would change page and the component was about to be destroyed.

I practically worked around it, by killing the component before it has a chance to crash.

// BaseSlider.vue

<template>
  <div>
    <div class="mb-6">
-       <VueSlickCarousel v-bind="vueSlickCarouselConfig" ref="sliderEl" :arrows="false">
+       <VueSlickCarousel v-if="$slots.default && $slots.default.length" v-bind="vueSlickCarouselConfig" ref="sliderEl" :arrows="false">
        <slot></slot>
      </VueSlickCarousel>
    </div>
    <div class="flex flex-row gap-3">
      <button @click="showPrev">
        <NuxtImg
          src="/img/icons/prev.svg"
          width="40"
          height="40"
          loading="lazy"
          decoding="async"
          alt="arrow pointing left"
          class="select-none"
        />
      </button>
      <button @click="showNext">
        <NuxtImg
          src="/img/icons/next.svg"
          width="40"
          height="40"
          loading="lazy"
          decoding="async"
          alt="arrow pointing right"
          class="select-none"
        />
      </button>
    </div>
  </div>
</template>

<script lang="ts">
const vueSlickCarouselConfig = {
  infinite: false,
  speed: 600,
  variableWidth: false,
  adaptiveHeight: false,
  autoplay: false,
  slidesToScroll: 1,
  swipeToSlide: true,
  slidesToShow: 3,
  responsive: [
    { breakpoint: 1280, settings: { slidesToShow: 2 } },
    { breakpoint: 640, settings: { slidesToShow: 1 } },
  ],
}

export default defineComponent({
  setup() {
    const sliderEl = ref()

    function showPrev() {
      sliderEl.value?.prev()
    }

    function showNext() {
      sliderEl.value?.next()
    }

    return { vueSlickCarouselConfig, sliderEl, showPrev, showNext }
  },
})
</script>

maninak avatar Feb 18 '22 11:02 maninak

TypeError: Cannot read properties of undefined (reading 'prevArrow')

Using Vue3 .. Same problem

sarjid avatar Feb 25 '22 06:02 sarjid

Vue3, same issue here ...😑

mdhasanpatwary avatar Feb 27 '22 09:02 mdhasanpatwary

Vue3, same issue here ...😑

at least iam using this package.. it's work in vue3 poperly .. https://ismail9k.github.io/vue3-carousel/examples.html#autoplay-example

sarjid avatar Mar 08 '22 03:03 sarjid

Same, ive face this issue.What can i do..?

Hasnain-js avatar Jun 09 '22 06:06 Hasnain-js

same issue here ...😑 what is the solution to this problem??

salman3040 avatar Jun 18 '22 11:06 salman3040

is there a solution to this error Cannot read properties of undefined (reading 'prevArrow')

alfredthompsonOvie avatar Sep 13 '22 12:09 alfredthompsonOvie

hey man. Just Use swiper slider.it's very easy to use. iam using it without any problem. https://swiperjs.com/vue https://swiperjs.com/demos#space-between

sarjid avatar Sep 14 '22 18:09 sarjid

use you can use swiper slider .. it's very easy man.. https://swiperjs.com/demos#space-between

On Tue, Sep 13, 2022 at 6:44 PM alfred thompson ovie < @.***> wrote:

is there a solution to this error Cannot read properties of undefined (reading 'prevArrow')

— Reply to this email directly, view it on GitHub https://github.com/gs-shop/vue-slick-carousel/issues/214#issuecomment-1245360010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWCZZQXU42YIHTERPI3QILV6BZKJANCNFSM5EUT6CYQ . You are receiving this because you commented.Message ID: @.***>

sarjid avatar Sep 14 '22 18:09 sarjid

same issue.

Rehman-Ali avatar Jan 18 '23 11:01 Rehman-Ali

same issue.

onderakbulut avatar May 03 '23 19:05 onderakbulut

Same issue

mark1282 avatar May 12 '23 14:05 mark1282