title: Angular 8 fails to build after migration from Angular 7
body: <p>After I migrated my project to Angular 8, the build fails with this strange error:</p>
  
  <pre><code>    ERROR in HostResourceLoader: loader(C:/myapp/cli/src/app/pages/user-home/user-home.component.html) returned a Promise 
      i ｢wdm｣: Failed to compile.
  </code></pre>
  
  <p>but when I save any file the application builds ok after recompiling:</p>
  
  <pre><code>i ｢wdm｣: Compiling...
  i ｢wdm｣: Compiled successfully.
  </code></pre>
  
  <p>So initially it fails to load the template file specified in <em>templateUrl</em> at this specific line in Angular Compiler resource loader:
  <a href="https://github.com/angular/angular/blob/master/packages/compiler-cli/src/ngtsc/resource_loader.ts#L111" rel="nofollow noreferrer">https://github.com/angular/angular/blob/master/packages/compiler-cli/src/ngtsc/resource_loader.ts#L111</a>
  and it is unclear in a what way the template url relates to a returned promise error.</p>
  
  <p>What could be wrong and what does that specific error mean?
  I guess it is some bug in the resource loader since recompiling on the fly works but the initial build fails.</p>
  
  <p><strong>UPD</strong></p>
  
  <p>Migrated from Angular 7 via <code>ng update</code> command, so changes are minimal.</p>
  
  <p>I'm using webpack 4 that works fine with Angular 7, possibly some webpack options should be changed.</p>
  
  <p>It is unclear what the root cause of the error is from the error description. Looking into the source of the compiler shed no light.</p>
  
  <p>Tried to reproduce it with pure (no webpack) Angular migrated from 7 to 8 using some markup templates via `templateUrl'.</p>