unable to build using prod
when I try to use --aot to build a project with FlashMessagesModule I get an error
ERROR in Error: Unexpected value ‘FlashMessagesModule in x/node_modules/angular2-flash-messages/module/module.d.ts’ imported by the module ‘AppModule in x/src/app/app.module.ts’. Please add a @NgModule annotation.
does FlashMessagesModule not work with aot yet?
The problem is, that there are no ngc metadatas, that are requiered for the usage with --aot or --prod.
is that something that the angular2-flash-messages should provide or?
@gemal I think so. Anyway I got a same problem. I use angular version 5 and angular2-flash-messages version 2.0.0
@gemal Yeah, they need to kick the ngc (angular compiler) and provide the generated metadata for the angular-cli.
@gemal , @peymannj published updated package. Please update and let me know if problem still persists.
@moff I updated to 2.0.1 and also I removed forRoot() function. Now I get new error message :
ERROR in Error: Error encountered resolving symbol values statically. Could not resolve @angular/core relative to D:/Project/node_modules/angular2-flash-messages/module/module.d.ts., resolving symbol FlashMessagesModule in D:/Project/node_modules/angular2-flash-messages/module/module.d.ts, resolving symbol FlashMessagesModule in D:/Project/node_modules/angular2-flash-messages/module/module.d.ts
I have this error when I run "ng build --prod"
@gemal , @peymannj Hm, I think this problem has something to do with this https://github.com/angular/angular-cli/issues/4647
@gemal , @peymannj check this comment https://github.com/angular/angular-cli/issues/4647#issuecomment-305967234
Thank you so much. The answer in the link works !
Specifying paths to @angular inside AngularCLI's tsconfig.json prevented the error from happening.
"paths": { "@angular/*": ["../node_modules/@angular/*"] }