Recep Duman
Recep Duman

Reputation: 366

unable to find bean reference frameworkOverrides while initialising BeanStub

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

Upvotes: 8

Views: 11720

Answers (4)

Rafael Stepan
Rafael Stepan

Reputation: 670

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.

Upvotes: 0

Hansi
Hansi

Reputation: 1

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))

Upvotes: 0

Borys Seiryk
Borys Seiryk

Reputation: 186

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;
}

Upvotes: 1

Recep Duman
Recep Duman

Reputation: 366

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

Upvotes: 0

Related Questions