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

Unhandled Promise rejection: Cannot read properties of undefined (reading 'length') #16

Open
2 tasks done
Enes5519 opened this issue Oct 31, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@Enes5519
Copy link

Checks

Version

0.2.9

Description

When I opened my console I saw the following error, although it was difficult to debug I found it. In the code snippet I posted below prevSlides is undefined, which is why we get the length error.

https://github.com/Splidejs/svelte-splide/blob/master/src/lib/components/Splide/Splide.svelte#L114

There is a situation where afterUpdate is also working while onMount is working. By the way, we have fixed slides.

Reproduction Link

No response

Steps to Reproduce

        hasTrack={false}
        aria-label="Önyüz Gösterimi Slaytı"
        options={{ pagination: false, rewind: false }}
      >
        <div class="slide-header">
          <div class="preview-text">Önyüz Gösterimi</div>
          <div class="splide__arrows">
            <Button class="splide__arrow--prev" size="small" kind="neutral" variant="tertiary" icon="arrow_left" />
            <Button class="splide__arrow--next" size="small" kind="neutral" variant="tertiary" icon="arrow_right" />
          </div>
        </div>

        <SplideTrack>
          {#each info.images as image}
            <SplideSlide>
              <AssetImage class="image" name={image} alt={info.title + " örneği"} />
            </SplideSlide>
          {/each}
        </SplideTrack>
      </Splide>```

`info.images` is guaranteed to be full.

### Expected Behaviour

In isEqualShallow, it is possible to check if undefined is received as an argument, or if the prevSlides variable is undefined, do not put it into the equal operation at all.
@Enes5519 Enes5519 added the bug Something isn't working label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant