title: Setting up Angular Universal App for development
body: <p>I have created a project with Angular-CLI. (using command: <code>ng new my-angular-universal</code>).
  Then I carefully followed all the instructions from <a href="https://github.com/angular/angular-cli/wiki/stories-universal-rendering" rel="noreferrer">https://github.com/angular/angular-cli/wiki/stories-universal-rendering</a></p>
  
  <p>It builds for <code>--prod</code> and works fine. But there are no instructions on how I can set up a <code>--dev</code> build and have it served with <code>--watch</code> flag.</p>
  
  <p>I tried removing <code>--prod</code> flags from npm "scripts", and it doesn't even run in dev mode. It builds fine but when I open it in browser this is what I see (directly printed to response):</p>
  
  <pre><code> TypeError: Cannot read property 'moduleType' of undefined
      at C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:7069:134
      at ZoneDelegate.invoke (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:105076:26)
      at Object.onInvoke (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:6328:33)
      at ZoneDelegate.invoke (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:105075:32)
      at Zone.run (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:104826:43)
      at NgZone.run (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:6145:69)
      at PlatformRef.bootstrapModuleFactory (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:7068:23)
      at Object.renderModuleFactory (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:52132:39)
      at View.engine (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:104656:23)
      at View.render (C:\Users\Mikser\documents\git\my-angular-universal\dist\server.js:130741:8)
  </code></pre>
  
  <p>the versions of npm packages that I use are currently the latest:</p>
  
  <ul>
  <li>@angular/* - @5.2.*</li>
  <li>@angular/cli @1.7.3</li>
  </ul>
  
  <p>except for ts-loader, had to downgrade it because it wasn't working:</p>
  
  <ul>
  <li>ts-loader @3.5.0</li>
  </ul>
  
  <p>So if anyone has any info on how to make this work, it would be very appreciated! Or maybe you know some project templates with Angular Universal App configured for both <code>--dev</code> and <code>--prod</code> builds and ability to <code>--watch</code>?</p>