unable to find bean reference frameworkOverrides while initialising BeanStub

Viewed 6030

I upgrade ag-grid to use ag-grid 23.2.0 in angular 7. When I filter page it works. Then I leave the page but I got an error like that. Does any one have any idea?

unable to find bean reference frameworkOverrides while initialising BeanStub
4 Answers

In my case, the root cause of this error was that I am trying to use the API of grid which has been unmounted. And my solution was whenever grid is remounted again API object has to replaced.

onGridReady(params) {
    this.gridApi = params.api;
}

I downgrade to 23.0.0 and it works fine. maybe you can get an error

ERROR in ./node_modules/ag-grid-angular/fesm5/ag-grid-angular.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
> node --max_old_space_size=16384 ./node_modules/@angular/cli/bin/ng build --prod
TypeError: Cannot read property 'kind' of undefined

If you use 23.0.0 ag-grid version. You should change

 "buildOptimizer": true,  -->   "buildOptimizer": false,

in angular.json

For me this error seems to have come from a duplicate chart ID issue. I have two tabs with one grid in each. The chart in both tabs are using the same ID. For some reason the component wasn't properly destroyed when switching tabs, meaning that I had duplicate IDs across tabs, so I just inserted an extra variable in order to make each of the two IDs unique across both tabs.

I went from this:

chartContainer: document.querySelector('#chart' + this.id)

To this:

chartContainer: document.querySelector('#chart' + this.id + (this.userTab ? 0 : 1))

On the destroy event cycle of your context, call the .destroy() method on your Ag-Grid API and also unsubscribe/cancel/abort the pending request for the grid rows.

Related