angular2-jwt icon indicating copy to clipboard operation
angular2-jwt copied to clipboard

ERROR in Error encountered resolving symbol values statically.

Open yarosdev opened this issue 9 years ago • 2 comments

ERROR in Error encountered resolving symbol values statically. Reference to a non-exported function (position 5:10 in the original .ts file), resolving symbol AuthModule in ..../app/modules/auth.module.ts

` import { NgModule } from '@angular/core'; import { Http, RequestOptions } from '@angular/http'; import { AuthHttp, AuthConfig} from 'angular2-jwt';

function authHttpServiceFactory(http: Http, options: RequestOptions) { return new AuthHttp(new AuthConfig({ tokenName: '_token', tokenGetter: (() => localStorage.getItem('_token')), globalHeaders: [{ 'Content-Type' : 'application/json' }], }), http, options); }

@NgModule({ providers: [ { provide: AuthHttp, useFactory: authHttpServiceFactory, deps: [Http, RequestOptions] } ] }) export class AuthModule {} `

yarosdev avatar Mar 20 '17 19:03 yarosdev

See #305

bibulle avatar Mar 23 '17 14:03 bibulle

I have a solution that works well for me in https://github.com/angular/angular-cli/issues/3707. It basically boils down to using the angular compiler (ngc) instead of the typescript compiler (tsc), and making sure your tsconfig-aot.json is configured properly

efreethy-revprep avatar Apr 12 '17 19:04 efreethy-revprep