I am currently in the process of upgrading my Angular 8 application to Angular 9. When running the migration command, I encountered the following issue:
Undecorated classes with DI migration.
As of Angular 9, it is no longer supported to use Angular DI on a class that does not have an Angular decorator.
Learn more about this at: https://v9.angular.io/guide/migration-undecorated-classes
This migration utilizes the Angular compiler internally, which means projects that fail to build after the update cannot run the migration successfully. Please ensure there are no AOT compilation errors and try running the migration again. The project that failed is: libs/core/tsconfig.lib.json
Error: ~/core-routing.module.ts:138:1: An error occurred in the metadata generated for the exported symbol 'CoreRoutingModule':
~/core/src/lib/core-routing.module.ts:25:23: There is an error in the collected metadata that will be reported at runtime: Lambda not supported.
{"__symbolic":"error","message":"Lambda not supported","line":24,"character":22}
Not all undecorated classes using dependency injection could be migrated. Some project targets were unable to be analyzed due to TypeScript program failures.
Rerun the migration with: "ng update @angular/core --migrate-only migration-v9-undecorated-classes-with-di"
Migration complete.
Nx workspace : 8.12.0
Angular : 8