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

[Revisited] ReferenceError: ResizeObserver is not defined #141

Open
asans opened this issue Jun 28, 2023 · 3 comments · May be fixed by #142
Open

[Revisited] ReferenceError: ResizeObserver is not defined #141

asans opened this issue Jun 28, 2023 · 3 comments · May be fixed by #142

Comments

@asans
Copy link

asans commented Jun 28, 2023

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.

@asans asans linked a pull request Jun 28, 2023 that will close this issue
@CharlesAttend
Copy link

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

@suryamsj
Copy link

suryamsj commented Oct 21, 2023

Hi, Can you share the code?

@rodrez
Copy link

rodrez commented Oct 27, 2023

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
Copy link

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

Thank u

@vannirriesarmiento
Copy link

thankusomuch!

teonbrooks added a commit to teonbrooks/projet-vie that referenced this issue Sep 21, 2024
Got the carousel to work thanks to a PR (vadimkorr/svelte-carousel#141)
Added a thumbtack thanks to this codepen: https://codepen.io/jamielife/pen/LpGWWP
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

Successfully merging a pull request may close this issue.

5 participants