JavadRasouli / ng2-permission

permission based access control for your angular2 applications.
MIT License
53 stars 19 forks source link

Ng2Permission is not an NgModule #9

Open vrudikov opened 7 years ago

vrudikov commented 7 years ago

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)
HariAlexiev commented 6 years ago

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 commented 6 years ago

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