-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
Consider the following files:
types.ts
export interface ITokenStorageService {
getToken():string;
setToken(token:string):void;
}
export const enum LoginState {
LogginIn, LoggedIn, NotLoggedIn
}
token.ts
import {ITokenStorageService} from './types';
export default class TokenStorageService implements ITokenStorageService {
private userToken:string;
getToken():string {
return this.userToken;
}
setToken(token:string) {
this.userToken = token;
}
}
When compiling this on the browser, the following error appears:
importerModule.setters[importerIndex] is not a function
I traced it to https://github.com/systemjs/systemjs/blob/master/lib/register.js#L287.
The problem is that the transpiled token.js file has no setters but the types file is registered as a dependency of the token module. I think this has to do with JSPM and how it registers the imports even if typescript doesn't register the dependency at runtime?
For now I just added a bandaid fix:
if (importerIndex < importerModule.setters.length) {
importerModule.setters[importerIndex](exports);
}
Any ideas? Thanks!
Metadata
Metadata
Assignees
Labels
No labels