angular: AOT compiler doesn't generate *.ngfactory.ts files for 3rd party components in node_modules

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When running ngc the compiler doesn’t codegen components inside node_modules when the component isn’t exported (export * from './my.component';) from the module. There are no errors emitted and all the *.metadata.json files for the libraries exist.

Expected behavior

For ngc to successfully codegen all 3rd party components without having to export the components publicly

Reproduction of the problem Checkout this repo: https://github.com/mattlewis92/angular2-tv-tracker

npm install
npm run ngc

You will then see that only one ngfactory.ts module file is emitted for each 3rd party module inside of the aot/module_modules folder, but none of the other components are codegen’d. As you can see from the screenshot, the reference to the './directives/calendarTooltip.directive.ngfactory' file is created but the file itself doesn’t exist.

screen shot 2016-09-24 at 15 35 24

If you need any more info let me know!

Please tell us about your environment:

OSX

  • Angular version: 2.0.X

    2.0.1

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

    N/A

  • Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript

  • Node (for AoT issues): node --version =
    v5.11.0

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (18 by maintainers)

Commits related to this issue

Most upvoted comments

+1

I am working on a fix…

@tbosch Can you look at this? From my initial investigation, this shouldn’t be an error, we are just not emitting the code when we should.

The component is exported from its module and the only difference between the working and non-working versions is whether the component is exported from the module index which shouldn’t make a difference.