如何解决尝试迁移到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
解决方法
strictMetadataEmit是库的标志,因此完全不应有任何延迟加载的模块。它不打算用于应用程序。
"strictMetadataEmit": false,
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。