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

dropdown.ngfactory missing / AOT bug #953

Closed
JohannesRudolph opened this issue Oct 24, 2016 · 6 comments
Closed

dropdown.ngfactory missing / AOT bug #953

JohannesRudolph opened this issue Oct 24, 2016 · 6 comments
Milestone

Comments

@JohannesRudolph
Copy link

Bug description:

I've tried to create an AOT build using angular-cli and ng-bootstrap. However, there appears to be an issue during AOT compilation generating an ngfactory for the dropdown component (see below).

Is anyone else able to AOT build with ng-bootstrap?

> ng build --target=${TARGET:-development} --environment=${ENVIRONMENT:-dev} --aot=${AOT:-false}

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
 13% building modules 28/113 modules 85 active ...rap/ng-bootstrap/dropdown/dropdown.jsresolve '../node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory' in '/Users/jr/dev/console/console/src/app'
  using description file: /Users/jr/dev/console/console/package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/jr/dev/console/console/package.json (relative path: ./src/app)
    using description file: /Users/jr/dev/console/console/package.json (relative path: ./src/node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory)
      as directory
        /Users/jr/dev/console/console/src/node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory doesn't exist
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/jr/dev/console/console/src/node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/jr/dev/console/console/src/node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/jr/dev/console/console/src/node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory.js doesn't exist

/Users/jr/dev/console/console/node_modules/webpack/lib/Compiler.js:220
                    if(err) return callback(err);
                    ^
TypeError: Cannot read property 'hash' of undefined
    at /Users/jr/dev/console/console/node_modules/angular-cli/tasks/build-webpack.js:35:26

Link to minimally-working plunker that reproduces the issue:

Not applicable

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.1

ng-bootstrap: 1.0.0-alpha.9

Bootstrap: 4.0.0-alpha.5

angular-cli: 1.0.0-beta.18

@pkozlowski-opensource
Copy link
Member

@JohannesRudolph I can't seem to reproduce based on the info given (please note that we do have another bug in the AoT support (details in #959) but it is not what you are reporting...

On top of this I don't see angular-cli: 1.0.0-beta.18 in the npm repository:

npm ERR! No compatible version found: @angular/compiler-cli@1.0.0-beta.18
npm ERR! Valid install targets:
npm ERR! 2.2.0-beta.0, 2.1.1, 2.1.0, 2.1.0-rc.0, 2.1.0-beta.0, 0.6.4, 0.6.3, 0.6.2, 0.6.1, 0.6.0, 0.5.0, 0.4.1, 0.4.0, 0.3.0, 0.2.0

Could you please put together a minimal repository that would illustrate the problem? Otherwise it is hard to progress on that one...

@sgybas
Copy link

sgybas commented Oct 24, 2016

@pkozlowski-opensource Thanks for your great work. I think you mixed up angular-cli and @angular/compiler-cli.

I got the same error message today when I tried angular-cli so I created a repository to illustrate the problem: https://github.com/sgybas/ng-bootstrap-953
However, I'm not sure that this as actually a problem in ng-bootstrap. It could also be a bug in angular-cli.

@JohannesRudolph
Copy link
Author

awesome work @sgybas

To determine whether this is a bug in angular-cli or ng-bootstrap it would help to know whether others have successfully used ng-bootstrap with AOT before (and in particular the dropdown). Depending on that outcome, we should file the issue over at angular-cli.

@pkozlowski-opensource
Copy link
Member

@sgybas thnx for the reproduce. I think that what you are guys hitting is a bug in ng itself that was just fixed via a838aba756df510daa3899f73c3732ef4fc571f2. Let's wait for the next ng release (it should be released today).

@spock123
Copy link

spock123 commented Oct 26, 2016

Dropdown factory also missing in my aot builds...

Angular 2.1.1
Webpack 2.1.0-beta.22
ng-bootstrap: Alpha 9

Both the Datepicker and Dropdown modules fail:

ERROR in ./compiled/src/app/components/shell/navigation/navigation.component.ngfactory.ts
Module not found: Error: Can't resolve '../../../../../node_modules/@ng-bootstrap/ng-bootstrap/dropdown/dropdown.ngfactory' in '/Users/spock/projects/branches/Iticket-Frontend/compiled/src/app/components/shell/navigation'
 @ ./compiled/src/app/components/shell/navigation/navigation.component.ngfactory.ts 19:0-111
 @ ./compiled/src/app/components/app.component.ngfactory.ts
 @ ./compiled/src/app/app.module.ngfactory.ts
 @ ./src/app/index.aot.ts

ERROR in [default] /Users/spock/projects/branches/Iticket-Frontend/compiled/node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker.ngfactory.ts:145:8 
Supplied parameters do not match any signature of call target.

ERROR in [default] /Users/spock/projects/branches/Iticket-Frontend/compiled/src/app/components/shell/navigation/navigation.component.ngfactory.ts:131:29 
Module ''*'' has no exported member 'Wrapper_NgbDropdown'.

ERROR in [default] /Users/spock/projects/branches/Iticket-Frontend/compiled/src/app/components/shell/navigation/navigation.component.ngfactory.ts:134:35 
Module ''*'' has no exported member 'Wrapper_NgbDropdownToggle'.

ERROR in [default] /Users/spock/projects/branches/Iticket-Frontend/compiled/src/app/components/shell/navigation/navigation.component.ngfactory.ts:929:29 
Module ''*'' has no exported member 'Wrapper_NgbDropdown'.

ERROR in [default] /Users/spock/projects/branches/Iticket-Frontend/compiled/src/app/components/shell/navigation/navigation.component.ngfactory.ts:932:35 
Module ''*'' has no exported member 'Wrapper_NgbDropdownToggle'.

@pkozlowski-opensource
Copy link
Member

I was able to reproduce with Angular 2.1.1 using https://github.com/pkozlowski-opensource/ng-bootstrap-aot

There is a mix of Angular bugs that we can work-around as well as few things that we've messed up... Sent #973 to fix both...

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

Successfully merging a pull request may close this issue.

4 participants