title: typescript extend class with imported class
body: <p>If I extend a locally exported class, it works.</p>
  
  <p>Working example:</p>
  
  <pre><code>export class classA {
  
      constructor() {
          super();
      }
  }
  
  export class classB extends classA {
  
  constructor() {
      super();
  
      this.do();
  }
  
  private do(): void {
      // do something
  }
  </code></pre>
  
  <p>But when I import classA from outside of the file it's not work.</p>
  
  <p>not Working example:</p>
  
  <pre><code>import { classA } from '../'; // I use index.ts file, so the reference is good.
  
  export class classB extends classA {
      constructor() {
          super();
  
          this.do();
      }
  
      private do(): void {
          // do something
      }
  }
  </code></pre>
  
  <p>File structure:</p>
  
  <pre><code>Root/
  - index.ts
  
  - classA(folder)/
     - index.ts
     - classA.ts
  
  - classB(folder)/
     - index.ts
     - classB.ts
  </code></pre>
  
  <p>The index.ts file inside classA folder:</p>
  
  <pre><code>export * from './classA';
  </code></pre>
  
  <p>The root index.ts file:</p>
  
  <pre><code>export * from './classB';
  export * from './classA';
  </code></pre>
  
  <p>Error message:
  class classB extends _1.classA 
  TypeError: Class extends value undefined is not a constructor or null</p>
  
  <p>I need to load outside from this file, because I would like to use classA in other files... Any idea why happen this?</p>
  
  <p><strong>[Solved]</strong>:
  In the root index.ts file the order have to be:</p>
  
  <pre><code>export * from './classA';
  export * from './classB';
  </code></pre>