Skip to content
Advertisement

How to get rid of Function calls are not supported in decorators in Angular aot compiling?

I am testing a Highcharts Angular2x Wrapper. At first, I had no problem using Angular CLI (1.6.1) “ng serve” and profiling performance with Chrome. Then, i tried to use ahead-of-time compiling to see how that affects the performance.

So, using:

JavaScript

I get the following error:

JavaScript

Now, i know that aot generates factory code for modules and somehow “transformes” templates to VanillaJS, things get a bit tricky here and i couldn’t understand how ngc is going to generate factory code for a module that requires an external library.

I got this App.Module.ts:

JavaScript

My Package.json dependencies :

JavaScript

My questions are : Is there anything i can do here to avoid the mentioned compiling error ? Can anyone explain why does this happen ? (optional)

Advertisement

Answer

Mentioning the Github issue here. The following solution worked for me.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement