4

I am running a hybrid PhoneGap app (for a several years, running Cordova Android 6.1.2, more recently 9.0); for years, our #1 javascript error by a significant margin has been

ResizeObserver loop limit exceeded

However, the key distinction for my issue compared to the many other reports found on Google of this error is is that there are 0 instances of ResizeObserver being used anywhere in my code. Searching my entire computer, the only instance of ResizeObserver showing up anywhere is a random Steam file. Looking at my app while it's running, setting window.ResizeObserver = undefined doesn't break/do anything and document.resizeObservers (per the W3C documentation) returns nothing.

I have seen this post, which seems to be the canonical one for this error: ResizeObserver - loop limit exceeded . The answer of "This error means that ResizeObserver was not able to deliver all observations within a single animation frame. It is benign (your site will not break)." would be sufficient for me if I was actually using ResizeObserver. Since I am not using it, I am concerned that this error showing up is indicative of something larger going wrong.

There is no discernible pattern from our users' Chrome version/locale/time zone/Android version/etc/etc, unfortunately.

I've researched this API extensively and have found nothing that would indicate to my issue; either why there would be some sort of phantom ResizeObserver running and/or why that error would show up in an app that doesn't use that API.

Any help here (even just a vague direction to look at) would be very much appreciated. Thanks so much!

Sergio Prado
  • 1,197
  • 2
  • 16
  • 33

1 Answers1

8

https://bugs.chromium.org/p/chromium/issues/detail?id=809574

Even the browser's Shadow DOM may be using this API, and cause this error to fire.
You can still safely ignore it.

Kaiido
  • 123,334
  • 13
  • 219
  • 285
  • 3
    This was it! Chrome was automatically attaching an observer to a video tag. For folks' future reference: the occurrence of ResizeObserver does appear to be associated with taxing the CPU/GPU. Consistent with Kaiido, there's no actual problem and it can be ignored, but if you're really trying to squeeze out every last percent out of your performance, it could be a signal to look at. – Sergio Prado Sep 04 '20 at 18:56
  • 1
    Note that a comment near the bottom of the Chromium issue also gives a workaround for the issue. (the observer is still attached, but the width of the video controls element is locked using css, avoiding the loop-limit-exceeded error/notification) – Venryx Oct 19 '20 at 12:50