Skip to content
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

Events being received from outside components, causing exception #8

Closed
malindsay opened this issue Aug 11, 2022 · 1 comment
Closed

Comments

@malindsay
Copy link

malindsay commented Aug 11, 2022

When using svelte-swiper, it appears it's receiving events from other components, and receiving this:
bundle.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'c')
at j (bundle.js:1:3342)
at Object.o (bundle.js:1:151293)
at transition_out (index.mjs:1137:15)
at Object.outro [as o] (ConsoleCards.svelte:121:74)

ConsoleCards is basically:

 <Swiper className="swiper-container-cons" {options} >
    {#if consoleCards && consoleCards.length > 0} 
      {#each consoleCards as item}
        <SwiperSlide>
          <div class="consoles-card">
            <h4>{$_(item.name)}</h4>
            <p class="card-desc">{$_(item.desc)}</p>
            {#if item.links}
              {#each item.links as link}
                {#if link.url}
                  <div class="console-link" on:click|self={openConsoleLink(link)}>
                    <Button size="small" kind="ghost">{$_(link.name)}</Button>
                  </div>
                {:else if link.marketingLink || link.marketingTopic && link.default === true}
                  <div class="console-marketing" on:click|self={openModal(link)}>
                    <Button size="small" kind="ghost" icon={Information}>{$_(link.name)}</Button>
                  </div>
                {/if}
              {/each}
            {/if}
          </div>
        </SwiperSlide>
      {/each}
    {/if}

    <div class="swiper-pagination swiper-pagination-cons" slot="pagination"></div>
    <div class="swiper-button-next swiper-button-next-cons" slot="button-next"></div>
    <div class="swiper-button-prev swiper-button-prev-cons" slot="button-prev"></div>
  </Swiper>`

with options:

  const options = {
    spaceBetween: 6,
    pagination: {
      el: '.swiper-pagination-cons',
      clickable: true
    },
    navigation: {
      nextEl: '.swiper-button-next-cons',
      prevEl: '.swiper-button-prev-cons'
    },
    observer: true, 
    observeParents: true,
    breakpoints: {
      640: {
        slidesPerView: 2,
        spaceBetween: 20,
      },
      768: {
        slidesPerView: 4,
        spaceBetween: 6,
      },
      1024: {
        slidesPerView: 5,
        spaceBetween: 6,
      },
      1400: {
        slidesPerView: 5,
        spaceBetween: 6
      }
    }
  }
@beomy
Copy link
Owner

beomy commented Aug 12, 2022

This is a known issue. sveltejs/svelte#3964
This issue is duplicated #2

@beomy beomy closed this as completed Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants