question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(bug) HttpOptions.headers:HttpHeaders compatibility issue with aot compilation

See original GitHub issue

Running $ 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:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
vmasekcommented, May 21, 2018

After some tests, it would be best if the options we provide for params and headers 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.

0reactions
vmasekcommented, May 22, 2018

the fix should be in master now, @resistancecanyon please try the latest version and see if there is everything resolved.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found