title: Failed to list lazy routes: Unknown module './src/app/app.module#AppModule'
body: <p>Afte upgrading to Angular 9 (from Angular 8) and running <code>ng build</code> I am getting </p>
  
  <pre class="lang-none prettyprint-override"><code>ERROR in Failed to list lazy routes: Unknown module './src/app/app.module#AppModule'.
  </code></pre>
  
  <p>It seems that the main app module cannot be found. </p>
  
  <p>This is my <strong>main.ts</strong> file:</p>
  
  <pre class="lang-js prettyprint-override"><code>import { enableProdMode } from '@angular/core';
  import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  
  import { AppModule } from './app/app.module';
  import { environment } from './environments/environment';
  
  if (environment.production) {
    enableProdMode();
  }
  
  platformBrowserDynamic().bootstrapModule(AppModule)
    .catch(err =&gt; console.error(err));
  </code></pre>
  
  <p>I have created a new project and was able to run it successfully.</p>
  
  <p>This means that there changed something from 8 to 9.</p>
  
  <p>Any ideas what I have to change?</p>