vadimkorr / svelte-carousel

The awesome carousel component for Svelte 3 :arrow_left: :art: :arrow_right:
https://vadimkorr.github.io/svelte-carousel
Apache License 2.0
285 stars 63 forks source link

[Revisited] ReferenceError: ResizeObserver is not defined #141

Open asans opened 1 year ago

asans commented 1 year ago

Per #139, this happens because ResizeObserver does not exist in SSR mode.

I am making use of some SSR of a preview page in astro. Setting client:visible doesn't work in this case for the component that relies on the Carousel component.

The issue is that the ResizeObserver is being created on module load.

Instead, what can likely be done here is to move and create the resize observer INSIDE the onMount(), which should solve the issue.

CharlesAttend commented 1 year ago

Hello, I'm currently facing the same issue and thank you for your pull request :D

suryamsj commented 11 months ago

Hi, Can you share the code?

rodrez commented 11 months ago

Hi, Can you share the code? @suryamsj You could do pnpm i vadimkorr/svelte-carousel#pull/142/head to install svelte-carousel with @asans update.

suryamsj commented 11 months ago

You could do pnpm i vadimkorr/svelte-carousel#pull/142/head to install svelte-carousel with @asans update. @rodrez

Thank u

vannirriesarmiento commented 5 months ago

thankusomuch!