title: Angular: 7.2.1 ES6 class ReferenceError : Cannot access 'X' before initialization
body: <p>I'm having the following TypeScript class </p>
  
  <pre><code>export class Vehicule extends TrackableEntity {
    vehiculeId: number;
    constructor() {
      super();
      return super.proxify(this);
    }
  }
  </code></pre>
  
  <p>my typescript target in tsconfig.json is configured as es6:</p>
  
  <pre><code>"compilerOptions": {
      "module": "es2015",
      "moduleResolution": "node",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "target": "es6",
  }
  </code></pre>
  
  <p>At runtime, here in Chrome, the code is failing with:</p>
  
  <pre><code>ReferenceError: Cannot access 'Vehicule' before initialization
      at Module.Vehicule (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:10559:100)
      at Module../src/app/domain/models/VehiculeGpsBoxInfo.ts (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:11156:69)
      at __webpack_require__ (https://localhost:44338/runtime.js:84:30)
      at Module../src/app/domain/models/Vehicule.ts (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:10571:78)
      at __webpack_require__ (https://localhost:44338/runtime.js:84:30)
      at Module../src/app/components/dispositifsDATI/mainDATI/listDATI/listDATI.component.ts (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:6447:82)
      at __webpack_require__ (https://localhost:44338/runtime.js:84:30)
      at Module../src/app/components/dispositifsDATI/index.ts (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:3053:95)
      at __webpack_require__ (https://localhost:44338/runtime.js:84:30)
      at Module../src/app/components/dispositifsDATI/dispositifsDATI.routes.ts (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:2982:64)
  </code></pre>
  
  <p>I needed to change es5 to es6 to solve <a href="https://stackoverflow.com/questions/51860043/javascript-es6-typeerror-class-constructor-client-cannot-be-invoked-without-ne">this other problem</a>.</p>
  
  <hr>
  
  <p>EDIT:
  The VehiculeGpsBoxInfo.ts file is importing Vehicule like this:</p>
  
  <pre><code>import { Vehicule } from "./Vehicule";
  </code></pre>
  
  <p>EDIT 2: I vould say that this may be webpack related, the way that modules are exported/imported in the genrated modules.</p>
  
  <p>EDIT 3: After further research, this seems to have nothing to do with the code shown above. Started a new question about <a href="https://stackoverflow.com/questions/56884546/do-i-need-to-configure-webpack-for-es6">webpack and ES6</a>.</p>