Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping. in angular 10 code example
Example: ngular JIT compilation failed: '@angular/compiler' not loaded!
// run
> npm i
// and then rebuild
> ng serve
// run
> npm i
// and then rebuild
> ng serve