AG-Grid /w Angular 11 Error: The target entry-point "ag-grid-angular" has missing dependencies

Viewed 1888

I've stepped this project up from Angular 8 to 11. AG-Grid's compatibility table claims Angular 7 - 10+ is compatible with AG Grid Version 24+. Has anyone anyone successfully tested the "plus" of "10+" and succeeded running any version of AG-Grid under Angular 11?

$ ng build

An error occurred during the build:
Error: The target entry-point "ag-grid-angular" has missing dependencies:
 - @angular/core
 - ag-grid/main
 - ag-grid

    at TargetedEntryPointFinder.findEntryPoints (C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
    at C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:28:41
    at SingleProcessExecutorSync.SingleProcessorExecutorBase.doExecute (C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:28:29)
    at C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:59
    at SyncLocker.lock (C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
    at SingleProcessExecutorSync.execute (C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
    at Object.mainNgcc (C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\src\main.js:74:25)
    at Object.process (C:\Workspace\Portal\node_modules\@angular\compiler-cli\ngcc\index.js:29:23)
    at NgccProcessor.processModule (C:\Workspace\Portal\node_modules\@ngtools\webpack\src\ngcc_processor.js:163:16)
    at C:\Workspace\Portal\node_modules\@ngtools\webpack\src\ivy\host.js:55:18
    at C:\Workspace\Portal\node_modules\@ngtools\webpack\src\ivy\host.js:47:24
    at Array.map (<anonymous>)
    at Object.host.resolveModuleNames (C:\Workspace\Portal\node_modules\@ngtools\webpack\src\ivy\host.js:45:32)
    at actualResolveModuleNamesWorker (C:\Workspace\Portal\node_modules\typescript\lib\typescript.js:102904:133)
    at resolveModuleNamesWorker (C:\Workspace\Portal\node_modules\typescript\lib\typescript.js:103126:26)
    at resolveModuleNamesReusingOldState (C:\Workspace\Portal\node_modules\typescript\lib\typescript.js:103200:24)

And package.json

{
  "name": "portal",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --proxy-config proxy.conf.json",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ngcc"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^11.2.3",
    "@angular/cdk": "^7.2.1",
    "@angular/common": "^11.2.3",
    "@angular/compiler": "^11.2.3",
    "@angular/core": "^11.2.3",
    "@angular/forms": "^11.2.3",
    "@angular/localize": "^11.2.3",
    "@angular/material": "^7.2.1",
    "@angular/platform-browser": "^11.2.3",
    "@angular/platform-browser-dynamic": "^11.2.3",
    "@angular/platform-server": "^11.2.3",
    "@angular/router": "^11.2.3",
    "@ng-bootstrap/ng-bootstrap": "^9.0.2",
    "ag-grid-angular": "^25.1.0",
    "ag-grid-community": "^25.1.0",
    "bootstrap": "^4.2.1",
    "core-js": "^2.5.1",
    "date-fns": "^1.28.5",
    "font-awesome": "^4.7.0",
    "lodash": "^4.17.11",
    "nan": "^2.14.1",
    "ngx-mask": "^11.1.4",
    "rxjs": "^6.5.5",
    "ts-helpers": "^1.1.2",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  }
}
1 Answers

For me, and the problem seems to be very specific to the Angular version you are using, the following worked for me:

"@ag-grid-community/all-modules": "^25.1.0",
"@ag-grid-community/angular": "^25.1.0",

These seem to be not documented everywhere, however these were needed. The process also needed this:

"ag-grid-angular": "^25.1.0",

My issue right now with the documentation:

https://www.ag-grid.com/angular-grid/getting-started/

Is that it doesn't mention anything about the "@" packages. This worked for me, my approach would be to experiment with the packages and take it from there. It's not 100% right now for sure.

Related