ng-masonry-grid icon indicating copy to clipboard operation
ng-masonry-grid copied to clipboard

Compatible with Angular Ivy - Angular 9

Open onilleksh opened this issue 4 years ago • 1 comments

ERROR in node_modules/ng-masonry-grid/ng-masonry-grid.module.d.ts:5:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (ng-masonry-grid) which declares NgMasonryGridModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

I have updated my application to Angular 9. And this is what I am getting while building the application.

Angular CLI: 9.1.1 Node: 12.16.2 OS: linux x64

Angular: 9.1.1 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, localize, platform-browser ... platform-browser-dynamic, platform-server, router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.1 @angular-devkit/build-angular 0.901.1 @angular-devkit/build-optimizer 0.901.1 @angular-devkit/build-webpack 0.901.1 @angular-devkit/core 9.1.1 @angular-devkit/schematics 9.1.1 @angular/cdk 9.2.0 @angular/material 9.2.0 @angular/material-moment-adapter 8.2.3 @ngtools/webpack 9.1.1 @schematics/angular 9.1.1 @schematics/update 0.901.1 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.1

I was able to fix the same error for primeng by just updating its version to latest. Looking for a reply soon...

onilleksh avatar Apr 14 '20 12:04 onilleksh

A work around for this issue (not perfect). Just disable the ivy in tsconfig.json.

...
"angularCompilerOptions": {
    ...
    "enableIvy": false
    ...
  }
...

Further reference: https://angular.io/guide/ivy

maxlam79 avatar Jun 15 '20 13:06 maxlam79