There are two typescript files:
- a module that implements the class Client
export class Client {
- a main file that imports the module and creates an array of clients
import c = module("client")
//...
class Server {
constructor() {
this.clients = new c.Client[];
Compiling the code seems to work fine. But when I try to run the generated javascript with nodejs, it complains that there is a syntax error:
this.clients = new ();
On the client side there's typescript code, too. But instead of modules, I'm using declaration paths and the --out compiler flag to compile everything into one .js file. Arrays in the client-side code are created without problems. In the javascript there's
this.arr = new Array();
So obviously the compiler just forgot to add specify that an Array is created with new()
. I fixed the error manually by just inserting the missing part. But after a small change to the code and a new compilation, the same problem appeared again.
I'm using typescript version 0.8.3 and installed via npm. What can I do ?