ERROR in TypeError: Cannot read property 'flags' of undefined

edit

If you use angular 9.1.6 it should be fine now

npm update @angular/cli @angular/core

original post

Something is broken in Angular 9.1.5 - if you run the following it should work:

npm install @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected]

ng build

Just spent about 4-5 hours trying to fix it myself...

The issue seems to stem from using Angular CLI 9.1.4 with Angular 9.1.5 (most likely the compiler

You'll see the issue when you do

ng --version

if you get:

Angular CLI: 9.1.4
Node: 12.16.3
OS: win32 x64

Angular: 9.1.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Then you will need to follow the npm installs i listed above


Got the same problem updating from 10.1.0 to 11.1.1.

Updating TypeScript to the latest Version from 4.0.2 to 4.1.3 solved the problem:

npm i typescript@latest


9.1.6 just released, should fix that issue