TypeError: Object prototype may only be an Object or null: undefined Angular 8

I had the same problem with my angular@7 project after updating the CLI globally to version 8 and solve it by upgrading angular in my project to the latest version by running this command in my project directory:

ng update @angular/cli @angular/core

You can also use the allow-dirty flag to bypass the repo check:

ng update @angular/cli @angular/core --allow-dirty

Also, there are other things to watch for when upgrading that has mentioned here:
https://update.angular.io/#7.0:8.0

Leave a Comment