# To update to Ionic 5
npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save-exact --save
# To update to Angular 9
ng update @angular/core @angular/cli
But when I did ionic serve
, I started getting the following error:
Error: 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.
at getCompilerFacade (core.js:610)
at Function.get (core.js:16065)
at getInjectableDef (core.js:362)
at injectableDefOrInjectorDefFactory (core.js:16816)
I ran into several Angular GitHub issues:
They say include import '@angular/compiler';
in file main.ts
, but when I mapped one of my other Angular 9 apps (which I recently updated) I don’t see any such configurations there.
SOLUTION
Add import '@angular/compiler';
to file main.ts
.