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

Uncaught "ResizeObserver loop limit exceeded" #488

Closed
1 task done
Tracked by #321
hmartiins opened this issue May 30, 2023 · 19 comments · Fixed by #493
Closed
1 task done
Tracked by #321

Uncaught "ResizeObserver loop limit exceeded" #488

hmartiins opened this issue May 30, 2023 · 19 comments · Fixed by #493
Labels
bug Something isn't working resolved This issue is resolved

Comments

@hmartiins
Copy link

hmartiins commented May 30, 2023

Bug is related to

  • embla-carousel (core package)

Embla Carousel version

  • "embla-carousel-react": "8.0.0-rc05",

Describe the bug

  • I could not identify a step by step to reproduce this error, it happened sometimes in a production environment and I was able to capture this error through Datadog. This error started happening right when I migrated to version 8.0.0-rc05. My carousel didn't glitch or crash, but I got this error on my console. I'm using NextJS in my project.

Steps to reproduce

I just browsed my website and every time I entered the page I had this message

Expected behavior

  • I would not want to get this error on my console.

Additional context

image

@hmartiins hmartiins added the bug Something isn't working label May 30, 2023
@davidjerleke
Copy link
Owner

@hmartiins please share more helpful information when creating a bug report. For example, this bug report is very clear and doesn’t leave you with many questions. At the time of writing I have no idea how to reproduce this.

  • Have you browsed the web like StackOverflow to try to understand why or when this is happening?
  • Is this only happening with NextJS or can you reproduce it without it?

This error started happening right when I migrated to version 8.0.0-rc05.

  • Migrated from which version?

@VadymBezsmertnyi
Copy link

In the Safari 16.4 (18615.1.26.110.1) browser console, when using embla-carousel 8.0.0-rc02 to 8.0.0-rc05, the following error occurs: [Error] ResizeObserver loop completed with undelivered notifications.
However, when using embla-carousel 7.1.0, there are no errors.
I am using embla-carousel for a regular React application.
Additionally, if I add watchResize: false to the settings of useEmblaCarousel where embla-carousel is used, the error also disappears. Occasionally, it also appears on Chrome, but I haven't been able to track when and how it happens.

@davidjerleke
Copy link
Owner

davidjerleke commented May 31, 2023

Thanks for chiming in with additional details @VadymBezsmertnyi.

At this point I need to understand why this is happening and possible solutions. If you or anyone else has any useful information about this - please share.

@davidjerleke
Copy link
Owner

@hmartiins and/or @VadymBezsmertnyi when does this error appear in the console? As soon as the carousel mounts? If you have additional details on how to reproduce this, please share.

@hmartiins
Copy link
Author

@davidjerleke what i noticed is when the carousel is mounted on the screen. I'll try to provide a codesandbox trying to simulate the error. The difficult thing is, I haven't encountered this error so far in a local environment, I'm just getting error messages and alerts about this in a production environment. From what I analyzed in my monitoring tool, this error occurred both in the android and in the IOS environment, so far I have not caught any reports of this error on the desktop. From the replays of the sessions in which this error occurs, the carousel does not break

@davidjerleke
Copy link
Owner

Thanks for the additional details @hmartiins 👍🏻. I’ll try to reproduce the error using BrowserStack then.

@davidjerleke davidjerleke added the investigating Issue is being looked into label Jun 1, 2023
@hmartiins
Copy link
Author

@davidjerleke So, I simulated it here on browserstack and was able to see the error on my console. It looks like it only occurs on real mobile devices.

image

@davidjerleke
Copy link
Owner

@hmartiins that’s very helpful. Thanks!

@davidjerleke
Copy link
Owner

davidjerleke commented Jun 1, 2023

@hmartiins that's so weird. I tried reproducing the error with BrowserStack but it did not throw any errors 😕. Additionally, your last error message is different from the first?

Would you mind creating a CodeSandbox with a carousel setup that triggers the error in BrowserStack and provide what iOS version you’re using?

There is an app view that should behave and work pretty much as any browser without the editing layers:

IMG_7131

@VadymBezsmertnyi
Copy link

@davidjerleke With the addition of watchResize:false in the options, it doesn't throw an error, but it doesn't resize adaptively either. To change the size of the object, a reload is needed. I also tested it on 8.0.0-rc01, and it still throws an error. The error occurs whenever there is a change in the object where embla-carousel is located or responds.

@tobimori
Copy link

tobimori commented Jun 2, 2023

I can confirm this error but it doesn't seem to have caused any issues

davidjerleke added a commit that referenced this issue Jun 2, 2023
@davidjerleke
Copy link
Owner

Allright I was finally able to reproduce it. One way to do it is to flip the iPhone in BrowserStack. The error is also thrown whenever the slide container is resized.

@hmartiins, @VadymBezsmertnyi or @tobimori I would very much appreciate if you could try to reproduce the error in this CodeSandbox with the bug fix I added.

Let me know if the error is gone or not.

Best,
David

@davidjerleke davidjerleke linked a pull request Jun 2, 2023 that will close this issue
@tobimori
Copy link

tobimori commented Jun 2, 2023

Works for me.

@davidjerleke
Copy link
Owner

@tobimori you mean no more ResizeObserver errors?

@tobimori
Copy link

tobimori commented Jun 2, 2023

@tobimori you mean no more ResizeObserver errors?

yeah

@davidjerleke
Copy link
Owner

@hmartiins, @VadymBezsmertnyi let me know if you're intending to test the fix too.

Best,
David

@VadymBezsmertnyi
Copy link

Thank you, @davidjerleke . I tried your code in CodeSandbox, and the error doesn't occur. I also tried version 8.0.0-rc06 in the project, and the error is still reproducible.

davidjerleke added a commit that referenced this issue Jun 6, 2023
@davidjerleke davidjerleke added resolved This issue is resolved and removed investigating Issue is being looked into labels Jun 6, 2023
@davidjerleke davidjerleke changed the title Uncaught "ResizeObserver loop limit exceeded" | NextJS Uncaught "ResizeObserver loop limit exceeded" Jun 6, 2023
@davidjerleke
Copy link
Owner

davidjerleke commented Jun 6, 2023

@hmartiins, @VadymBezsmertnyi and @tobimori, a bugfix for this problem has been released with v8.0.0-rc07. Thanks for the help 👍.

@davidjerleke davidjerleke mentioned this issue May 31, 2023
37 tasks
@VadymBezsmertnyi
Copy link

Thank you, @davidjerleke. Everything is working perfectly and without any errors in the console. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved This issue is resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants