Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when converting AG Grid to enterprise

I am currently trying to convert a project I have that is using AG Grid free to enterprise free trial. However, when following the instructions on the AG Grid site I am getting this error:

Uncaught TypeError: Cannot read property 'EnterpriseCoreModule' of undefined

Thinking it might probably be due to the project I created I tried building on a new one but I am still getting the same error.

Has anyone encountered this error? Looked on the net and could didn't find any results. Can anyone help in activating my AG Grid to enterprise?

like image 972
Allen Rodney Jereza Avatar asked Nov 27 '25 23:11

Allen Rodney Jereza


1 Answers

Fine. let's proceed installation step by step

  1. install all dependencies
npm i --save ag-grid-angular
npm i --save ag-grid-community
npm i --save ag-grid-enterprise
  1. import deps in app.module.ts
import {AgGridModule} from "ag-grid-angular";
@NgModule({
    imports: [
        AgGridModule.withComponents([])]
})
  1. import ag-Grid styles - in styles.scss
@import "~@ag-grid-community/all-modules/dist/styles/ag-grid.css";
@import "~@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css";

4.setting the license key in main.ts

but the order of the modules is IMPORTANT!

We recommend setting the license key in your main boot files (typically named either main.ts or boot.ts, before you bootstrap your application.

import { LicenseManager } from "ag-grid-enterprise";


LicenseManager.setLicenseKey("YOUR_KEY");
platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.error(err));
like image 117
shutsman Avatar answered Nov 30 '25 21:11

shutsman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!