error: An unhandled exception occurred: Object prototype may only be an Object or null: undefined when migrating from Angular 7 to 9

Viewed 169

I am trying to migrate an application from Angular 7 to Angular 9.

ng version returns:

Angular CLI: 9.1.7
Node: 10.15.0
OS: win32 x64

Angular: 7.2.16


Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.7
@angular-devkit/build-angular     0.900.7
@angular-devkit/build-optimizer   0.900.7
@angular-devkit/build-webpack     0.900.7
@angular-devkit/core              9.1.7
@angular-devkit/schematics        9.1.7
@angular/cdk                      9.2.4
@angular/cli                      9.1.7
@angular/common                   9.1.11
@angular/compiler-cli             9.1.11
@angular/material                 9.2.4
@ngtools/webpack                  9.1.7
@schematics/angular               9.1.7
@schematics/update                0.901.7
rxjs                              6.5.5
typescript                        3.7.5
webpack                           4.43.0

when I attempt to build I get the above error.

The log returns:

[error] TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at Object.__extends (C:\source\repos\AM-Vendors\node_modules\tslib\tslib.js:69:9)
    at C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:117:17
    at C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:324:6
    at C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:3:17
    at Object.<anonymous> (C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:9:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:20:22
    at C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:10:17
    at Object.<anonymous> (C:\source\repos\AM-Vendors\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:16:3)

I don't know why the version report Angular-Cli at 9.1.7 and then Angular at 7.2.16, nor how to change the Angular version showing 7.2.16.

0 Answers
Related