Angular2 AoT Compiler Errors
See original GitHub issueWhen I try to compile my project with ngc, it throws the below error:
Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 92:25 in the original .ts file), resolving symbol AppModule in
In my App Module I have the below providers and probably this is causing the project. I am not sure what exactly is wrong with this?
providers: [
GlobalService,
{
provide: Http,
useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, globalService: GlobalService) => new HttpLoading(backend, defaultOptions, globalService),
deps: [XHRBackend, RequestOptions, GlobalService]
}
],
Issue Analytics
- State:
- Created 7 years ago
- Reactions:39
- Comments:52 (23 by maintainers)
Top Results From Across the Web
AOT metadata errors - Angular
The following are metadata errors you may encounter, with explanations and ... Avoid this error by sticking to the compiler's restricted expression syntax ......
Read more >Improved Error Logging by the Angular AOT Compiler
In Angular 10.1, another error logging improvement by the AOT compiler is introduced. Let's see how the error logging has improved over the...
Read more >angular - Why won't aot compiler error on missing property?
AoT compiles the template beforehand, and is looking for the bindings to be generated. On the other hand, having it in an ng-container...
Read more >Angular 6 AOT compilation not working - Error in ... - GitHub
I created minimal sample app to reproduce this error. The key point is that this app is AOT compiled using the webpack plugin...
Read more >Angular: Writing AoT-friendly applications | by David - Medium
Angular CLI comes with built-in AoT support. In the development target environment, it uses JiT (Just-in-Time) compilation for better developer experiences and ...
Read more >
Top Related Medium Post
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
pls try
/cc @chuckjaz
Oh for crying out loud. So to get decent load times for Angular2 apps we need to use ngc. To use NGC, we now need every every vendor of angular2 libs to now include a .metadata.json file? So now we’re dependent on that as well?
So what are we going to do since Angular2 allows people to write components in pure JS, and since JS is not Typescript, these libraries/modules will never have a .metadat.json and thus can never be used by AOT?
I’ve tried three different ways to shrink down a angular2 app to a decent size and reduce download times by bundling stuff up into one module, and all three have been dead ends. Various, errors, poor documentation, and our app takes 10 seconds to start due to the hundreds of npm deps it loads at boot.
Is there a sane "WORKS NOW’ way to make a single js bundled app file? Even with no AOT? For a 1.0 release this is maddening.
If I were to jump through these hopes, would I finally a single file, or nearly single Angular2 app? Or do I need to find a bundler that would then work with everything else we use?