Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to build using prod #31

Open
gemal opened this issue Nov 27, 2017 · 9 comments
Open

unable to build using prod #31

gemal opened this issue Nov 27, 2017 · 9 comments

Comments

@gemal
Copy link

gemal commented Nov 27, 2017

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?

@Dinistro
Copy link

The problem is, that there are no ngc metadatas, that are requiered for the usage with --aot or --prod.

@gemal
Copy link
Author

gemal commented Nov 27, 2017

is that something that the angular2-flash-messages should provide or?

@peymannj
Copy link

peymannj commented Nov 27, 2017

@gemal I think so. Anyway I got a same problem. I use angular version 5 and angular2-flash-messages version 2.0.0

@Dinistro
Copy link

@gemal Yeah, they need to kick the ngc (angular compiler) and provide the generated metadata for the angular-cli.

@moff
Copy link
Owner

moff commented Nov 27, 2017

@gemal , @peymannj published updated package. Please update and let me know if problem still persists.

@peymannj
Copy link

peymannj commented Nov 27, 2017

@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"

@moff
Copy link
Owner

moff commented Nov 27, 2017

@gemal , @peymannj Hm, I think this problem has something to do with this angular/angular-cli#4647

@moff
Copy link
Owner

moff commented Nov 27, 2017

@gemal , @peymannj check this comment angular/angular-cli#4647 (comment)

@peymannj
Copy link

peymannj commented Nov 27, 2017

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/*"] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants