title: Class constructor cannot be invoked without 'new' - typescript with commonjs
body: <p>I am making server side chat with colyseus (node game server framework). Im using typescript with module:commonjs because colyseus is built upon commonjs.</p>
  
  <p>I have class <code>ChatRoom</code> that extends <code>Colyseus.Room</code>. 
  At run-time I get this error:</p>
  
  <pre><code>Class constructor Room cannot be invoked without 'new'.
  </code></pre>
  
  <p>And the trouble in javascript:</p>
  
  <pre><code>function ChatRoom() {
     return _super !== null &amp;&amp; _super.apply(this, arguments) || this;
  }
  </code></pre>
  
  <p>from typescript class:</p>
  
  <pre><code>import {Room} from "colyseus";
  
  export class ChatRoom extends Room {
  
      onInit(options) {
          console.log("BasicRoom created!", options);
      }
  
      onJoin(client) {
          this.broadcast(`${ client.sessionId } joined.`);
      }
  
      onLeave(client) {
          this.broadcast(`${ client.sessionId } left.`);
      }
  
      onMessage(client, data) {
          console.log("BasicRoom received message from", client.sessionId, ":", data);
          this.broadcast(`(${ client.sessionId }) ${ data.message }`);
      }
  
      onDispose() {
          console.log("Dispose BasicRoom");
      }
    }
  </code></pre>
  
  <p>The error is easily skipped when troubled row is removed after compilation. But the base class is not created and this is not a complete solution.</p>
  
  <p>I googled the issue and it seems to relate to babel transpiler, though I don't use babel. I only use tsc / tsconfig.json.</p>