nativescript-angular: [Angular 10] - Function calls are not supported in decorators but 'NativeScriptRouterModule' was called

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.0.4
  • Cross-platform modules: 6.5.15
  • Android Runtime: 6.5.3
  • iOS Runtime: 6.5.2
  • NativeScript-Angular: 10.0
  • Angular: 10.0

Describe the bug I’ve migrated my project from NS 6.5.x and Ng 8.21 to Ng 9 and then to NG 10. Migration to Ng 9 was ok, I can start my application without Ivy enable. To migrate to Ng 9 I’ve followed this wiki: https://github.com/NativeScript/nativescript-angular/wiki/Updating-and-developing-for-@nativescript-angular-v9-with-Ivy-or-without

Then I made migration to Ng 10, following this post: https://nativescript.org/blog/upgrading-tips-for-angular-10/

I’ve fixed all build errors but now I have this and I don’t know how to solve:

ERROR in Error during template compile of 'AppRoutingModule'
  Function calls are not supported in decorators but 'NativeScriptRouterModule' was called.

Can you help me? Can I upgrade to Ng 10 without Ns 7 migration. I would like to migrate to NS 7 later when all plugins I use will offer NS 7 support.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 18

Most upvoted comments

@mapo80 and @armourjami

By upgrading to Angular 9. The wiki said you need to make the following change: disable Ivy by adding this to your project’s tsconfig.json with the following:

"compilerOptions": {
  ...your various options, etc.
},
"angularCompilerOptions": {
    "enableIvy": false
}

When you remove this

"angularCompilerOptions": {
    "enableIvy": false
}

from your tsconfig.json file the build should work again. I hope this also solves your issue?

Hi, Does anyone found the right fix instead of enabling Ivy ? I’m facing also this issue and enabling Ivy is making my app running but wondering the accuracy of this procedure. In my case the error is thrown by one of my generated lib but there is a lack of debugging to find which code block is origin of this error

Awesome thanks @DepickereSven. This does solve the issue. Thanks 😁