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.
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
- fix(compiler): walk third party modules fixes #11889 fixes #12399 — committed to vicb/angular by vicb 8 years ago
- fix(compiler): walk third party modules fixes #11889 fixes #12399 — committed to vicb/angular by vicb 8 years ago
- fix(compiler): walk third party modules fixes #11889 fixes #12399 — committed to vicb/angular by vicb 8 years ago
- fix(compiler): walk third party modules fixes #11889 fixes #12399 — committed to vicb/angular by vicb 8 years ago
- fix(compiler): walk third party modules fixes #11889 fixes #12428 — committed to vicb/angular by vicb 8 years ago
- fix(compiler): walk third party modules fixes #11889 fixes #12428 — committed to vicb/angular by vicb 8 years ago
- fix(compiler): walk third party modules (#12453) fixes #11889 fixes #12428 — committed to angular/angular by vicb 8 years ago
- fix(compiler): walk third party modules (#12453) fixes #11889 fixes #12428 — committed to angular/angular by vicb 8 years ago
+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.