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

ng-bootstrap causes AOT to fail with module not found errors. #796

Closed
qdouble opened this issue Sep 25, 2016 · 13 comments
Closed

ng-bootstrap causes AOT to fail with module not found errors. #796

qdouble opened this issue Sep 25, 2016 · 13 comments

Comments

@qdouble
Copy link

qdouble commented Sep 25, 2016

Bug description:

When I import @ng-bootstrap and run AOT, I get the following errors and more

ERROR in ./src/app/app.module.ngfactory.ts                                                                    
Module not found: Error: Can't resolve '../../node_modules/@ng-bootstrap/ng-bootstrap/alert/alert.ngfactory' i
n '/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/src/app'                                        
 @ ./src/app/app.module.ngfactory.ts 84:15-93                                                                 
 @ ./src/main.browser.aot.ts                                                                                  

ERROR in ./src/app/app.module.ngfactory.ts                                                                    
Module not found: Error: Can't resolve '../../node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker.ng
factory' in '/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/src/app'                              
 @ ./src/app/app.module.ngfactory.ts 85:15-103                                                                
 @ ./src/main.browser.aot.ts                                                                                  

ERROR in ./src/app/app.module.ngfactory.ts                                                                    
Module not found: Error: Can't resolve '../../node_modules/@ng-bootstrap/ng-bootstrap/popover/popover.ngfactor
y' in '/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/src/app'                                    
 @ ./src/app/app.module.ngfactory.ts 88:15-97                                                                 
 @ ./src/main.browser.aot.ts    

When I check the compiled files, it appears that many components are not being generated.

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.0.1

ng-bootstrap: 1.0.0-alpha.6

@pkozlowski-opensource
Copy link
Member

We need to investigate and might need to re-export all directives from index.ts (which would be less than ideal...). My understanding is the at the whole AOT + libs story has some gaps / moving parts so we will need several adjustments before things are seamless.

@pkozlowski-opensource
Copy link
Member

A (possibly) useful ref: angular/angular#11689

@qdouble
Copy link
Author

qdouble commented Sep 26, 2016

@pkozlowski-opensource I already have outdir and gendir that the person suggested in the link... I don't think there is anything wrong in particular settings, as I have material design branch that works just fine...I was trying to add a bootstrap branch to my seed starter project which AOT works otherwise fine with, but this is blocking creating bootstrap branch: https://github.com/qdouble/angular2webpack2-starter

@pkozlowski-opensource
Copy link
Member

The most probable suspect: angular/angular#11889

We need to investigate by creating a minimal project that uses ng-bootstrap.

@qdouble
Copy link
Author

qdouble commented Oct 6, 2016

@pkozlowski-opensource is there something blocking this being fixed or do you need me to create a more minimal repo first?

@qdouble
Copy link
Author

qdouble commented Oct 6, 2016

@pkozlowski-opensource I just uploaded the bootstrap branch of the starter project that I've been working on: https://github.com/qdouble/angular2webpack2-starter/tree/bootstrap

To reproduce the error, after installing. just run npm run compile

@pkozlowski-opensource
Copy link
Member

@qdouble thnx for the repro. There are still a bunch of errors in the AoT on the ng2 side and I want to take time in the coming days to fix them upstream or work-around here (but honestly I would rather prefer fixing stuff in the Angular itself as it will benefit the entire community).

@pkozlowski-opensource
Copy link
Member

@qdouble thnx to your repro I could just confirm that we are bumping into angular/angular#11889 (or a slight variation of it). I need to do a bit more testing but I will either check with Tobias to see how far the fix is or will just work-around it for now as we were planning to export things anyway in #779

Thnx for bearing with us, a fix is not far away :-)

@smyth64
Copy link

smyth64 commented Oct 8, 2016

I hope this get fixed soon. ng-bootstrap is the only thing in our projects that's preventing AoT/Universal. If I just knew, where to look at then I could help you guys 🙃

@pkozlowski-opensource
Copy link
Member

@smith64fx AoT is a top priority for us, all hands on the deck :-) I'm pretty positive that we are going to have a fix / workaround by Mon.

@smyth64
Copy link

smyth64 commented Oct 8, 2016

image

Yeah I think so, too. Nothing is impossible!

@pkozlowski-opensource
Copy link
Member

Ha! We've got a fix in #854. It just need review. I'm going to land it and cut a new release as soon as it is reviewed.

@pkozlowski-opensource
Copy link
Member

For anyone tracking AoT compatibility - I've just pushed alpha.7 to npm so you can download it and take for the test drive. Be sure to check the breaking changes section while updating! The demo site updated to alpha.7 should be up shortly.

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

No branches or pull requests

3 participants