title: angular_1.default.module Uncaught TypeError: Cannot read property 'module' of undefined
body: <p>I am creating a starter template using angular 1.6, webpack, gulp and typescript. I am able to compile and build my application but app is not bootstrapping. The issue is weird as when I am debugging <code>angular.module</code> is defined and module can be created from console <code>angular.module('testModule', [])</code> but as resume debugger I get exception in <code>core.module.ts</code> at <code>export const CoreModule = angular.module('app.core', []).name;</code>.</p>
  
  <p>I have further investigated this issue by disabling source code and I have found the problem. The above mentioned code compiles to <code>exports.CoreModule = angular_1.default.module('app.core', []).name;</code> where there is no property named <code>default</code> on angular_1.
  For code refer <a href="https://github.com/muditsaurabh/awesome-ng-starter" rel="nofollow noreferrer">https://github.com/muditsaurabh/awesome-ng-starter</a></p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'module' of undefined
      at Object.&lt;anonymous&gt; (app.bundle.js?cd4d443…:1)
      at e (vendor.bundle.js?cd4d443…:1)
      at Object.&lt;anonymous&gt; (app.bundle.js?cd4d443…:1)
      at e (vendor.bundle.js?cd4d443…:1)
      at Object.&lt;anonymous&gt; (app.bundle.js?cd4d443…:1)
      at e (vendor.bundle.js?cd4d443…:1)
      at window.webpackJsonp (vendor.bundle.js?cd4d443…:1)
      at app.bundle.js?cd4d443…:1
  vendor.bundle.js?cd4d443…:6Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
  Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
  http://errors.angularjs.org/1.6.1/$injector/nomod?p0=app
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:377
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11230
      at n (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:10668)
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11004
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20796
      at r (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:809)
      at h (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20644)
      at le (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:22631)
      at a (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8560)
      at st (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8870)
  http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=app&amp;p1=Error%3A%20%…2F%2Flocalhost%3A8000%2Fvendor.bundle.js%3Fcd4d4432605c6f5be56a%3A6%3A8870)
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:377
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11230
      at n (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:10668)
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11004
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20796
      at r (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:809)
      at h (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20644)
      at le (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:22631)
      at a (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8560)
      at st (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8870)
  http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=app&amp;p1=Error%3A%20%…2F%2Flocalhost%3A8000%2Fvendor.bundle.js%3Fcd4d4432605c6f5be56a%3A6%3A8870)
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:377
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:21073
      at r (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:809)
      at h (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20644)
      at le (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:22631)
      at a (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8560)
      at st (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8870)
      at at (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8109)
      at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:11:13916
      at HTMLDocument.n (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:17809)
  </code></pre>