尝试迁移到Angular 9时出错:为导出的符号生成的元数据中遇到错误

问题描述

我正在尝试将Angular 8应用程序转换为Angular9。在运行迁移命令时,我看到了:

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.
      Read more about this here: https://v9.angular.io/guide/migration-undecorated-classes
    
        This migration uses the Angular compiler internally and therefore projects that no longer build successfully after the update cannot run the migration. Please ensure there are no AOT compilation errors and rerun the migration. The following project failed: libs/core/tsconfig.lib.json
    
        Error: ~/core-routing.module.ts:138:1: Error encountered in metadata generated for exported symbol 'CoreRoutingModule':
         ~/core/src/lib/core-routing.module.ts:25:23: Metadata collected contains an error that will be reported at runtime: Lambda not supported.
          {"__symbolic":"error","message":"Lambda not supported","line":24,"character":22}
    
        Could not migrate all undecorated classes that use dependency
        injection. Some project targets could not be analyzed due to
        TypeScript program failures.
    
        Migration can be rerun with: "ng update @angular/core --migrate-only migration-v9-undecorated-classes-with-di"
    
      Migration completed.

Nx workspace : 8.12.0

Angular : 8

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)