1

We are currently upgrading an Angular 4 app to version 6. We configured our app to run in prod mode when using JIT compilation because it has 3rd party chart components that run on their own timer, which resulted in the occasional inevitable ExpressionChangedAfterItHasBeenCheckedError in DEV. These errors did not affect production.

For some reason, the main.ts file did execute in Angular 4, but it doesn't in version 6.

What would be the best way to run out Angular 6 app in production mode using JIT compilation?

Thanks!

Rob Gravelle
  • 325
  • 5
  • 23

1 Answers1

1

I found the answer in another stackoverflow question.

All I needed to do was add the call to enableProdMode() at the very beginning of my main app component:

import { Router, RouterModule, Params, ActivatedRoute } from '@angular/router';
import { Component, OnInit, ViewEncapsulation, NgZone, enableProdMode } from '@angular/core'; 

enableProdMode();

:-)

customcommander
  • 17,580
  • 5
  • 58
  • 84
Rob Gravelle
  • 325
  • 5
  • 23