Closed juliannemarik closed 5 months ago
@juliannemarik Thanks for creating this issue and sharing a solution. In terms of severity, how often have you run into the CI failing due to the benign error?
@jcfranco We recently ran into this issue when trying to use the max-items
prop on the calcite-dropdown
which I believe triggers the resizeObserver
callback to determine the height of the dropdown. Using this prop causes our CI (which runs our tests in Chrome) to fail.
This is the first time we've run into the issue, but I imagine we'll run into this issue again if we use other components or component props that leverage the resizeObserver
callback.
Ultimately this isn't very high severity, but the Hub team would like to be able to use the max-items
prop on the calcite-dropdown
, but this error is currently preventing us from doing so.
Just saw this on our CI as well when trying to add a test for a calcite-dropdown
.
@juliannemarik @hccampos Can you confirm if this error still occurring with calcite-dropdown
(and possibly other components) in the latest release? If so, we could look into the implementation to see if we can mitigate this.
I hesitate to use the suggested workaround for the reasons outlined in this reply. Also, there's a, stalled, discussion regarding this error being changed to a warning instead since it's benign.
Just tried it again in our CI and it seems like it's working well 👍
@hccampos Thanks for testing! Will close based on ☝️.
@juliannemarik Please feel free to reopen if you notice this issue again. Thanks!
Description
Chrome will occasionally throw an error,
ResizeObserver loop limit exceeded
. The error is benign and simply means thatResizeObserver
was not able to deliver all observations within a single animation frame. You can avoid this error by wrapping the callback inrequestAnimationFrame
which is what I'm proposing you do as an added precaution in yourcreateObserver
function:Proposed Advantages
Although the error is benign, it can cause CI to fail, and the proposal is a simple fix which will guard against this possibility
Which Component
observers.ts
utilRelevant Info
resizeObserverManager
inhub-components
. See here