AOT Compilation Error when importing Secondary Entry Points
See original GitHub issueType of Issue
[x ] Bug Report
[ ] Feature Request
Description
The following error is thrown when importing a secondary entry point in AOT mode.
ERROR in : Unexpected value ‘TestLabelModule in C:/Users/kkang/Sources/tester/tester/node_modules/@amat/theme/spinner/spinner.module.d.ts’ imported by the module ‘AppModule in C:/Users/kkang/Sources/tester/tester/src/app/app.module.ts’. Please add a @NgModule annotation.
How To Reproduce
- Create a library with secondary entry point.
- Import the component in another Angular project using the secondary entry point.
- Build using Angular CLI with --prod or --aot flag.
- Import the same component using the primary entry point, build will work without any errors.
I have created a testing repo which can be used to reproduce this issue: https://github.com/Karankang007/ng-packagr-testlib
import { TestLabelModule } from '@test/lib/label'; // Fails
import { TestLabelModule } from '@test/lib'; // Passes
Expected Behaviour
No compile or runtime errors in AOT mode.
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 2.4.1
@angular/compiler: 5.2.9
@angular/compiler-cli: 5.2.9
rollup: 0.55.5
tsickle: 0.27.2
typescript: 2.5.3
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Angular 5 AOT compilation failed - typescript - Stack Overflow
Important: Before separating the application by modules, the application worked well in production. The described problem appeared after ...
Read more >AOT metadata errors - Angular
Angular generates a class factory in a separate module and that factory can only access exported classes. To correct this error, export the...
Read more >Changelog | Burst | 1.6.6 - Unity - Manual
Fixed an internal compiler error when casting a void* to a pointer-to-vector and then access the element. Added. Burst now generates a link.xml ......
Read more >Ninja Squad: Le Blog
the polyfills.ts file has been removed. The polyfills option in angular.json now directly accepts an array of imports. To add zone ...
Read more >Angular 2 AOT Compilation - ANGULARarchitects
Notice the two entry points within the dist/unbundled-aot folder: the first points to the necessary polyfills and the second to the compiled ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We got a similar build like material (every component is its own module and a secondary entry point;) and moved now to a build using ng-packagr. This issue basically breaks the whole library when being used and build in a CLI project in AOT mode. Any updates on this issue?
@dherges Any updates on this? It’s currently a critical issue for us