I cannot tell you the exact string because you did not include the full @NgModule decorator. This error is usually found in the providers array if you have something like this:
@NgModule({ // imports, exports and declarations providers: [{ provide: XSRFStrategy, useValue: new CookieXSRFStrategy('RESPONSE_TOKEN', 'RESPONSE_TOKEN') }] }) export class MyModule {}
You cannot use AOT if you have a built-in function call. Instead, replace useValue with useFactory and the exported function (as indicated in the error message).
Here is the AOT-safe version of my first list:
export function xsrfFactory() { return new CookieXSRFStrategy('XSRF-TOKEN', 'X-XSRF-TOKEN'); } @NgModule({ // imports, exports and declarations providers: [{ provide: XSRFStrategy, useFactory: xsrfFactory }] }) export class MyModule {}
source share