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.

Angular 10 - Function calls are not supported in decorators but '' was called

See original GitHub issue

I have created an Ionic 5 Angular 10 project and I am importing some animations as I have done for previous projects. However I am getting the error below. Any ideas what is causing this?
Similar code works fire with another Ionic 5 Angular 9 project I created.

Is this an Angular 10 issue or a typescript issue perhaps?

Error during template compile of ‘AppComponent’ Function calls are not supported in decorators but ‘slideInLeftOnEnterAnimation’ was called

If I remove the brackets I get the following error:

ERROR Error: Unable to resolve animation metadata node #undefined at visitDslNode (browser.js:554) at AnimationAstBuilderVisitor.build (browser.js:695) at buildAnimationAst (browser.js:685) at InjectableAnimationEngine.registerTrigger (browser.js:3856) at registerTrigger (animations.js:166) at Array.forEach (<anonymous>) at AnimationRendererFactory.createRenderer (animations.js:170) at createRootComponentView (core.js:18357) at ComponentFactory$1.create (core.js:22157) at ApplicationRef.bootstrap

    import { slideInLeftOnEnterAnimation } from 'angular-animations';

    @Component({
      selector: 'app-root',
      templateUrl: 'app.component.html',
      styleUrls: ['app.component.scss'],
      animations: [
        slideInLeftOnEnterAnimation()
      ]
    })
  Ionic CLI                     : 6.11.11
   Ionic Framework               : @ionic/angular 5.3.5
   @angular-devkit/build-angular : 0.1000.8
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 2.3.3
   angular-animations": "^0.11.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
juanDaniel3332133commented, Nov 20, 2020

downgrading to version 0.0.10 works for angular 9. I was messing around for several hours.

1reaction
filipowscommented, Oct 12, 2020

Hi @madmacc,

The error in the editor is something I have come across. It should disappear once you compile the app e.g. run ng build.

The animation functions used in the decorator are statically analyzable and after the compilation, the errors should be gone and it shouldn’t cause any issues in the production build.

So far I haven’t found any solution for errors being shown in the editor until running the compilation step.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Angular 10] - Function calls are not supported in decorators ...
ERROR in Error during template compile of 'AppRoutingModule' Function calls are not supported in decorators but 'NativeScriptRouterModule' was ...
Read more >
How to get rid of Function calls are not supported in ...
I get the following error: ERROR in Error during template compile of 'AppModule' Function calls are not supported in decorators but ' ...
Read more >
Solving AOT Error in NgRx: Function calls are not supported in ...
Function calls are not supported in decorators but 'createAction' was called in 'reducers'. The core explanation for this error is well-covered in the ......
Read more >
Function calls are not supported in decorators but '' was called
I have created an Ionic 5 Angular 10 project and I am importing some animations as I have done for previous projects.
Read more >
Ahead-of-time (AOT) compilation - Angular
The AOT compiler does not support function expressions and arrow functions, also called lambda functions. Consider the following component decorator:.
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