angular - 将 NG-Zorro 从 V8 升级到 V9 给出:“Class extends value undefined is not a constructor or null”
问题描述
运行后ng update ng-zorro-antd
我们得到:
[error] TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\<user name>\Desktop\Work\<project name>\node_modules\ng-zorro-antd\schematics\ng-update\upgrade-rules\checks\calendar-input-rule.js:4:49)
这也发生在一个全新的 Angular 8 项目中。升级到 Angular 9 工作正常,但只有 NG-Zorro 更新失败。
这些是calendar-input-rule.js
错误中文件的内容:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular/cdk/schematics");
class CalendarTemplateRule extends schematics_1.MigrationRule {
constructor() {
super(...arguments);
this.ruleEnabled = this.targetVersion === schematics_1.TargetVersion.V9;
}
visitTemplate(template) {
schematics_1.findInputsOnElementWithTag(template.content, 'nzCard', ['nz-calendar'])
.forEach(offset => {
this.failures.push({
filePath: template.filePath,
position: template.getCharacterAndLineOfPosition(offset),
message: `Found deprecated input "nzCard" component. Use "nzFullscreen" to instead please.`
});
});
}
}
exports.CalendarTemplateRule = CalendarTemplateRule;
//# sourceMappingURL=calendar-input-rule.js.map
我看到有人说这可能是由于循环依赖,但应用程序运行正常,所以错误可能来自 NG-Zorro 的导入?这有什么解决方法吗?
解决方案
有同样的错误,删除 node_modules 并重新安装后一切都消失了。
推荐阅读
- r - 选择最高值和行均值的更快方法
- python - 多线程 Python 插入 Postgree
- resources - 列表中每个任务的不同资源分配
- java - 如何在套接字编程中将我的课程放在客户端中?
- c# - 如何在 C# 中查找多个变量 DateRanges 之间的间隙
- python - 将 Pyside-2 项目导入我由 Django 构建的网站
- javascript - 脚本文件未在 Safari 浏览器的 javascript 中加载
- java - 创建名为“passwordEncoder”的 bean 时出错:请求的 bean 当前正在创建中
- postgresql - 在 PostgreSQL 中将列的数据类型更改为整数(带有 n/a 的列)
- c - Lua如何将用户数据从元表__index放入C闭包?