Webpack bundle not working with AOT


I have been getting an error message every time I try to bundle my project using AOT.
So this command:
$ tns build android --bundle --env.aot
produces this error:

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

Webpack compilation complete.
Executing webpack failed with exit code 2.

If you need any extra info let me know



Since the error talks about AppRoutingModule would you mind pasting it here?


import { NgModule } from “@angular/core”;
import { NativeScriptRouterModule } from “nativescript-angular/router”;
import { Routes } from “@angular/router”;

import { ItemsComponent } from “./item/items.component”;
import { ItemDetailComponent } from “./item/item-detail.component”;

const routes: Routes = [
{ path: “”, redirectTo: “/items”, pathMatch: “full” },
{ path: “items”, component: ItemsComponent },
{ path: “item/:id”, component: ItemDetailComponent },

imports: [NativeScriptRouterModule.forRoot(routes)],
exports: [NativeScriptRouterModule]
export class AppRoutingModule { }

^ this is the app routing module


Can you provide more details about what AppKeys is?
(Module, service…etc. Where is it being used? What does it look like?)