ag-grid: ResizeObserver loop limit exceeded

I’m submitting a …

[x] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of ag-Grid'
[] support request => see 'Requesting Community Support'

Current behavior There is no issue during runtime but running our test suite (ci, docker) tests randomly fail because of the following error

ResizeObserver loop limit exceeded

Please tell us about your environment:

  • ag-Grid version: 18.1.1

  • Browser: Chrome Headless 68 stable (66, 67 and 69 beta also fail)

  • Language: Typescript 2.8.3 / ES5

Looking through the ag-grid source code i could not spot any issue. This https://github.com/ag-grid/ag-grid/blob/18.1.1/packages/ag-grid/src/ts/resizeObserver.ts#L396 looks actually ok.

Still i was wondering if the callback itself might be causing a resize event and then run into a loop, but the gotcha here https://developers.google.com/web/updates/2016/10/resizeobserver#gotcha says that this case is actually protected

However, this does not seem to be the case as this plunkr demonstrates https://jsfiddle.net/que_etc/ba1ad26e/ so i changed the ag-grid code at https://github.com/ag-grid/ag-grid/blob/master/packages/ag-grid/src/ts/resizeObserver.ts#L396 from this

for (const entry of entries) {
    callback(entry);
}

to this

for (const entry of entries) {
    setTimeout(function() {
        callback(entry);
    })
}

with the result that the error does not occur and the tests don’t fail any more.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 27 (4 by maintainers)

Commits related to this issue

Most upvoted comments

i was able to reproduce the behavior. Repository is located here https://github.com/giniedp/ag-grid-ro-issue

@Laurensvdw would you mind to review my reproduction and tell if it also breaks on your side?

meanwhile i am reporting back to ag-grid team.

Hi,

Thank you for your email. We are aware of this issue and have a feature request in our backlog:

You can follow the status of feature requests, bugs and releases using our pipeline: https://www.ag-grid.com/ag-grid-pipeline/

If you are an ag-Grid Enterprise Customer, please raise this in our Zendesk support system - contact info@ag-grid.com for access. This is our primary channel for Support.

This is the reference and summary of the relevant issue:

AG-2066 Create an opt out of the native ResizeObserver

I can confirm the error still exists. For me the sizeColumnsToFit() method is causing the error, resutling in the application to break. It is because I have a left side navigation and closing/opening/pinning the navigation makes the resizer run wild, as the main content holding the grid resizes (it is random, it does not occur every time…).

@giniedp Thanks for the solution, hopefully this time they will copy past your code 😉

It also works if you do sizeColumnsToFit() before you assign the datasource…

I can confirm the error still exists. For me the sizeColumnsToFit() method is causing the error, resutling in the application to break. It is because I have a left side navigation and closing/opening/pinning the navigation makes the resizer run wild, as the main content holding the grid resizes (it is random, it does not occur every time…).

@giniedp Thanks for the solution, hopefully this time they will copy past your code 😉

19.0.0 is out and AG-2028 had been marked as fixed although i can not find it any more. However our ci pipeline still fails randomly