title: Angular 9 Unhandled Promise rejection: Angular JIT compilation failed error
body: <p>I upgraded our app to Angular 9 yet in production testing I am getting this error. I am serving my app with the command <code>ng serve --optimization=true --aot=true --prod</code> before I deploy this to production and its just not working</p>
  
  <pre><code>Unhandled Promise rejection: Angular JIT compilation failed: '@angular/compiler' not loaded!
    - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.
    - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?
    - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping. ; Zone: &lt;root&gt; ;
  </code></pre>
  
  <p>This is pointing to my polyfills.ts</p>
  
  <p>I have added import "@angular/compiler to the top of my main.ts file with no luck.</p>
  
  <p>I have also removed all the imports from polyfill except for zone.js and still get the error. </p>
  
  <p>What does this mean and how can it be fixed?</p>