Reputation: 13352
I'm trying to understand why I'm having Unexpected Identifier
error in Typescript (1.4) Interface in chrome
The code:
interface IMessage {
target : string;
type : string;
data : Object;
}
I wonder maybe it is *.js.map file generated incorrectly. I use last WebStorm to generate them. The Imessage.js.map for that consists with that that content:
{"version":3,"file":"IMessage.js","sourceRoot":"","sources":["IMessage.ts"],"names":[],"mappings":"AAIC"}
IMessage.js
//# sourceMappingURL=IMessage.js.map
Upvotes: 4
Views: 8897
Reputation: 14557
From the looks of it, you are loading your TypeScript code .ts
in Chrome while you should load your .js
files.
When you write TypeScript files you can compile them with the compiler (tsc
) and it outputs .js
file which you can load in the browser nodejs or other JavaScript compatible stuff!
Upvotes: 1