(bug) HttpOptions.headers:HttpHeaders compatibility issue with aot compilation
See original GitHub issueRunning
$ ng build --prod
while the module is injected to the app.
We get the following error
ERROR in app/app.module.ts(14,21): Error during template compile of 'AppModule' Function calls are not supported in decorators but 'HttpHeaders' was called.
This might be due to the fact that simple assignments are only allowed during module declarations.
and we’re trying to pass new HttpHeaders(...header String/objects)
into the module declaration.
Possible Solution:
- Add a new optional config headersConfig into HttpOptions, which will be the input signature of HttpHeaders() constructor
- Make it working with this way as well.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
header-cell.component: AoT compilation problem #389 - GitHub
Current behavior AoT compilation throws error 'header-cell.component.ngfactory.ts:287:113: Operator '===' cannot be applied to types ...
Read more >Error after JIT/AOT compilation of Angular in Chrome console ...
In this blog the author compiled a list of compatibility between angular and nodejs versions. Angular 8.x is designed to be compatible with ......
Read more >angular/angular - Gitter
Hi! I am stucked with the problem. I've got a component with the template: <input type="radio" [attr.name]="groupName" [value]="rate" [(ngModel)]="value" />.
Read more >Ahead-of-time (AOT) compilation - Angular
In this phase, the compiler's StaticReflector interprets the metadata collected in phase 1, performs additional validation of the metadata, and throws an error...
Read more >Apache Tomcat 9 (9.0.70) - Changelog
66203: Log an error message when the JSP compiler is unable to create the output ... 65785: Perform additional validation of HTTP headers...
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
After some tests, it would be best if the options we provide for
params
andheaders
will be{[key: string]: string}
object and not constructed class.It will require to change some types and interfaces but it should be able to do it without breaking the outer API. I’ll cover that in PR soon.
the fix should be in master now, @resistancecanyon please try the latest version and see if there is everything resolved.