Running the app with JIT (ng serve) works perfectly, but when trying out AOT it failts with this error message:
./node_modules/.bin/ngc -p ./src
Error: Error encountered resolving symbol values statically. Calling function 'provideAuth', function calls are not supported. Consider replacing the function or lambda wi
th a reference to an exported function, resolving symbol AppModule in ......./app.module.ts
I have the same problem with exported member AUTH_PROVIDERS.
Any news on this? Is there any workaround?
Yes, you cannot use AOT with this library, maybe you'll need to do a JWTModule?
I'm using this with AOT:
export function authFactory(http: Http, options: RequestOptions) {
return new AuthHttp(new AuthConfig({
// Config options if you want
}), http, options);
};
// Include this in your ngModule providers
export const authProvider = {
provide: AuthHttp,
deps: [Http, RequestOptions],
useFactory: authFactory
};
@Manduro That fixed it dude, thanks a ton.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇♂️
Most helpful comment
I'm using this with AOT: