ng2-permission icon indicating copy to clipboard operation
ng2-permission copied to clipboard

Ng2Permission is not an NgModule

Open vrudikov opened this issue 7 years ago • 2 comments

Angular version: ^4.3.5 Angular CLI version: ^1.4.2

ERROR in Error: Ng2Permission is not an NgModule
at _getNgModuleMetadata (/Users/xxx/project/node_modules/@angular/compiler-cli/src/ngtools_impl.js:140:15)
at _extractLazyRoutesFromStaticModule (/Users/xxx/project/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26)
at /Users/xxx/project/node_modules/@angular/compiler-cli/src/ngtools_impl.js:129:27
at Array.reduce (native)
at _extractLazyRoutesFromStaticModule (/Users/xxx/project/node_modules/@angular/compiler-cli/src/ngtools_impl.js:128:10)
at Object.listLazyRoutesOfModule (/Users/xxx/project/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/Users/xxx/project/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (/Users/xxx/project/node_modules/@ngtools/webpack/src/plugin.js:207:44)
at _donePromise.Promise.resolve.then.then.then.then.then (/Users/xxx/project/node_modules/@ngtools/webpack/src/plugin.js:443:24)
at process._tickCallback (internal/process/next_tick.js:103:7)

vrudikov avatar Oct 30 '17 13:10 vrudikov

I have similar problem.. but only when I use "ng build --prod"

RROR in : Unexpected value 'Ng2Permission in ...../node_modules/angular2-permission/dist/module/ng2-permission.module.d.ts' imported by the module 'AppModule in ..../src/app/app.module.ts'. Please add a @NgModule annotation.

w/out the --prod flag is working correctly.

Any ideas ?

HariAlexiev avatar Feb 26 '18 15:02 HariAlexiev

Actually it seems to be related to AOT flag, if it is set to false the build is OK...

HariAlexiev avatar Feb 27 '18 07:02 HariAlexiev