-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ResizeObserver loop limit exceeded #2588
Comments
any plans on a fix for this coming out in a patch release? |
i was told, its being tracked as a bug now. |
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 |
Looking at the source code, there has been some work on the resize observer, but the issue has not been addressed. The old polyfill observer is gone, but the issue was with the native ResizeObserver when using Chrome and that is processing the callback directly as before. Changing the source code from const resizeObserver = new (<any>window).ResizeObserver(callback); to const resizeObserver = new (<any>window).ResizeObserver(() =>
frameworkFactory.setTimeout(callback)); fixes the issue and all tests pass |
I can confirm the error still exists. @giniedp Thanks for the solution, hopefully this time they will copy past your code ;) |
so i have been digging around and found the following. The resize observer is internally used in two places The first one is here The other one is here In my observation as soon as some padding is added to I still suggest to change the resize observer subscription as i initially proposed so that the layout operations are delayed into the next cycle. Doing so fixes the current issue and has no observable side effects and the resize observer does not trigger a second time. |
@Laurensvdw is your project anyhow publicly available where the issue can be reproduced? how often does it occur? ag-grid team asks for a reproducable example. For me it is only happening on a ci server and that is a bit hard to isolate, extract and reproduce. |
@giniedp Nice "Pink Panter" spy work ;) |
@Laurensvdw i've got a vanilla js ag-grid setup on stackblitz |
@giniedp It seems that it is not reproducible, my layout is much more complex than this.... Landing on the component and clicking on the button "Toggle menu state", most of the times cause the error, but not in the example :( |
thx anyway for trying |
i was able to reproduce the behavior. Repository is located here @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. |
I was able to sort out my scenario. We did not include stylesheets into the tests. This might introduce a layout mess into ag-grid. Adding stylesheets does let all tests pass again. This Leaves @Laurensvdw issue still unresolved. |
I think it is due to the nature of our "complex" layout. The side navigation has different modes which make the actual content resize. Even if we only have 4 columns, it still happens. My best guess is that it has something to do with the resizing (animation) of the content, which triggers the grid resizer (for every pixel?). I hope the team of ag-grid just implements your solution, and that it hopefully resolves the issue. |
yes, if there are animations, the new behavior of ag-grid will trigger the resize event once per animation step. I have changed my example on stackblitz https://stackblitz.com/edit/js-ag-grid but still cant break it. |
Used your column/row generation loops and added a transition for the margin-left when toggling the side navigation (to make the resizing even heavier). I can't break it either... I am starting to fear we are dealing with magic... ☠️ |
Hi Just to let you know that ag-grid staff is now going to monitor this thread to help find an answer to this issue (hence the ag-grid engaged label) Thanks for all the feedback |
Hi, We appreciate that there is an issue seen by many users, but we are struggling to reproduce in our end. Thanks at @giniedp for the repository. We are going to add a mechanism to opt-out of the native resize observer This is going to be in our next release
https://www.ag-grid.com/ag-grid-pipeline/ Note that we can't still fully reproduce this in our end, so we are not sure this will fully help you guys. If you do come up with a simple reproducible scenario, please let us know |
Hey Alberto, Thanks for following it up and providing a possible solution. We will implement the solution when it is available. The "bug" is indeed very hard to reproduce, in our case we have it 20% of the time, so no logic there... |
It also works if you do sizeColumnsToFit() before you assign the datasource... |
Reminds me of posting my progress... The real solution, for my environment, was to declare a certain height on the wrapping container. Apparently this was missing... Like if you would place the ag-grid directly on the body and you wouldn't declare "height:100%" on the body. Then the grid would do weird things like not showing any rows as the height cannet be retrieved or something like that... |
I'm getting this with:
|
We had this problem when we were using ResizeObserver in newer versions of Chrome as well and we just throttled it.
and it worked perfectly. |
For us this appears to be triggered when the side scrollbar is initially visible and then some rows are removed from the grid, so that the scrollbar is not visible any more. We have pinned columns on the right, so I was able to workaround the issue by making the right-hand scrollbar always visible:
|
Hi guys, Quick update, the opt out to not use the resizer is going to be introduced in v20.1 ETA 4/5 weeks, sorry for the long delay Thanks |
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: If you are an ag-Grid Enterprise Customer, please raise this in our Zendesk support system - contact [email protected] for access. This is our primary channel for Support. This is the reference and summary of the relevant issue:
|
I'm submitting a ...
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
to this
with the result that the error does not occur and the tests don't fail any more.
The text was updated successfully, but these errors were encountered: