MarkJ
MarkJ

Reputation: 411

Error Installing Ag-Grid-Enterprise on Angular

I tried installing ag-grid-enterprise on angular 7.3.3. I used this to install the license: https://www.ag-grid.com/javascript-grid-set-license/

Now, when I compile my code, it gives me this error:


ERROR in node_modules/ag-grid-enterprise/dist/lib/rangeController.d.ts(2,10): er                                                             ror TS2305: Module '"C:/Users/kb60500/fusion-portal/fusion-webapp/node_modules/a                                                             g-grid-community/main"' has no exported member 'CellPosition'.
node_modules/ag-grid-enterprise/dist/lib/rangeController.d.ts(2,81): error TS230                                                             5: Module '"C:/Users/kb60500/fusion-portal/fusion-webapp/node_modules/ag-grid-co                                                             mmunity/main"' has no exported member 'CellRangeParams'.
node_modules/ag-grid-enterprise/dist/lib/rangeController.d.ts(2,98): error TS230                                                             5: Module '"C:/Users/kb60500/fusion-portal/fusion-webapp/node_modules/ag-grid-co                                                             mmunity/main"' has no exported member 'CellRange'.
node_modules/ag-grid-enterprise/dist/lib/rangeController.d.ts(2,109): error TS23                                                             05: Module '"C:/Users/kb60500/fusion-portal/fusion-webapp/node_modules/ag-grid-c                                                             ommunity/main"' has no exported member 'RowPosition'.
node_modules/ag-grid-enterprise/dist/lib/rangeController.d.ts(3,22): error TS242                                                             0: Class 'RangeController' incorrectly implements interface 'IRangeController'.
  Property 'clearSelection' is missing in type 'RangeController'.
node_modules/ag-grid-enterprise/dist/lib/setFilter/setFilter.d.ts(2,10): error T                                                             S2305: Module '"C:/Users/kb60500/fusion-portal/fusion-webapp/node_modules/ag-gri                                                             d-community/main"' has no exported member 'ProvidedFilter'.
node_modules/ag-grid-enterprise/dist/lib/setFilter/setFilterModel.d.ts(2,10): er                                                             ror TS2305: Module '"C:/Users/kb60500/fusion-portal/fusion-webapp/node_modules/a                                                             g-grid-community/main"' has no exported member 'ProvidedFilterModel'.
node_modules/ag-grid-enterprise/dist/lib/widgets/selection/abstractSelectionHand                                                             le.d.ts(2,117): error TS2305: Module '"C:/Users/kb60500/fusion-portal/fusion-web                                                             app/node_modules/ag-grid-community/main"' has no exported member 'CellRange'.
node_modules/ag-grid-enterprise/dist/lib/widgets/selection/abstractSelectionHand                                                             le.d.ts(2,128): error TS2305: Module '"C:/Users/kb60500/fusion-portal/fusion-web                                                             app/node_modules/ag-grid-community/main"' has no exported member 'RowPosition'.
node_modules/ag-grid-enterprise/dist/lib/widgets/selection/abstractSelectionHand                                                             le.d.ts(2,141): error TS2305: Module '"C:/Users/kb60500/fusion-portal/fusion-web                                                             app/node_modules/ag-grid-community/main"' has no exported member 'CellPosition'.
node_modules/ag-grid-enterprise/dist/lib/widgets/selection/abstractSelectionHand                                                             le.d.ts(2,155): error TS2305: Module '"C:/Users/kb60500/fusion-portal/fusion-web                                                             app/node_modules/ag-grid-community/main"' has no exported member 'ISelectionHand                                                             le'.

This is my package.json

"dependencies": {
...
"ag-grid": "^18.1.2",
    "ag-grid-angular": "^20.2.0",
    "ag-grid-community": "^20.2.0",
    "ag-grid-enterprise": "^21.0.1"
}

I've imported it in app.module.ts already

import { AgGridModule } from 'ag-grid-angular';

Also imported it in the component im using:

import "ag-grid-enterprise";
import { GridApi, Grid, GridOptions } from 'ag-grid-community';
import { AgGridModule } from 'ag-grid-angular'; 

Upvotes: 1

Views: 3001

Answers (1)

MarkJ
MarkJ

Reputation: 411

My issue was that the versions of ag-grid-community and ag-grid-enterprise were not the same. Once I changed the version, it started working.

Upvotes: 2

Related Questions