【问题标题】:Kendo Angular2 Input Component Broken on AOT BuildAOT Build 上的 Kendo Angular2 输入组件损坏
【发布时间】:2017-06-28 02:46:54
【问题描述】:

我有一个使用 Angular2 的 Kendo UI 控件的简单应用程序。我也 AOT 编译我的应用程序。在我运行 npm update 并更新控件之前,一切正常。

自更新以来,AOT 构建失败。特别是这些故障似乎与 kendo-angular-inputs 组件有关。此外, npm start 不再干净地运行。 “干净”是指我应该能够发出运行命令以在应用程序的 JIT/AOT 版本之间无缝跳转。然而,事实并非如此。我将尝试描述以下情况:

部分工作版本

安装了 0.15.3 版 kendo-angular-inputs 的应用程序

  1. NPM 启动(在发出 AOT 构建命令之前)

    成功,应用运行

  2. 停止 lite-Server,运行:NPM AOT 构建

    成功,应用构建并运行

  3. 停止 lite-Server,运行:NPM 启动(发出 AOT 构建命令后)

    错误

aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(203,41): 错误 TS2341:属性“widgetClass”是私有的,只能访问 在“NumericTextBoxComponent”类中。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(208,41): 错误 TS2341:属性“numericClass”是私有的,只能访问 在“NumericTextBoxComponent”类中。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(242,48): 错误 TS2445:属性“hostBlur”受保护且只能访问 在类“NumericTextBoxComponent”及其子类中。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(490,46): 错误 TS2341:属性 'focused' 是私有的,只能在内部访问 类“数字文本框组件”。 aot/node_modules/@progress/kendo-angular-inputs/node_modules/@progress/kendo-angular-intl/dist/es/intl.module.ngfactory.ts(28,122): 错误 TS2339:类型“typeof”上不存在属性“字符串” “C:/0/Health/Dashboard-lite/node_modules/@progress/kendo-angular-inputs/node_modules/@prog...”。

此时我唯一能做的就是运行应用程序的 AOT 版本。除非我删除以下文件,否则 JIT 版本将不会运行(我认为这些是 AOT 编译中引用 kendo-angular-inputs 组件的所有文件):

AOT/APP

AOT/@progress

AOT/@telerik

非工作版本

安装了 0.18.6 版 kendo-angular-inputs 的应用程序

  1. NPM 启动(在发出 AOT 构建命令之前)

    成功,应用运行

  2. 停止 lite-Server,运行:NPM AOT 构建

    错误

错误在 C:/Dashboard-lite/aot/node_modules/@progress/kendo-angular-inputs/dist/es/slider/slider-ticks.component.ngfactory.ts:87:7: 提供的参数与调用目标的任何签名都不匹配。错误 在 C://Dashboard-lite/aot/node_modules/@progress/kendo-angular-inputs/dist/es/slider/slider.component.ngfactory.ts:207:7: 提供的参数与调用目标的任何签名都不匹配。

  1. 尝试运行:NPM Start since AOT is not working(在发出 AOT 构建命令之后)

    错误

aot/node_modules/@progress/kendo-angular-inputs/dist/es/maskedtextbox/maskedtextbox.component.ngfactory.ts(275,35): 错误 TS2346:提供的参数与调用的任何签名都不匹配 目标。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/maskedtextbox/maskedtextbox.component.ngfactory.ts(279,35): 错误 TS2346:提供的参数与调用的任何签名都不匹配 目标。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/maskedtextbox/maskedtextbox.component.ngfactory.ts(283,35): 错误 TS2346:提供的参数与调用的任何签名都不匹配 目标。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(195,41): 错误 TS2341:属性“widgetClass”是私有的,只能访问 在“NumericTextBoxComponent”类中。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(200,41): 错误 TS2341:属性“numericClass”是私有的,只能访问 在“NumericTextBoxComponent”类中。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/numerictextbox/numerictextbox.component.ngfactory.ts(214,48): 错误 TS2445:属性“hostBlur”受保护且只能访问 在类“NumericTextBoxComponent”及其子类中。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/slider/slider-ticks.component.ngfactory.ts(87,7): 错误 TS2346:提供的参数与调用的任何签名都不匹配 目标。 aot/node_modules/@progress/kendo-angular-inputs/dist/es/slider/slider.component.ngfactory.ts(207,7): 错误 TS2346:提供的参数与调用的任何签名都不匹配 目标。

同样,此时我必须删除相同的 AOT 文件才能运行 JIT 版本。我无法 AOT 编译。

更多信息:

  1. 我已经按照angular.iocookbook设置了AOT编译。
  2. 我已成功使用 kendo-angular-charts。 JIT/AOT 版本运行良好。
  3. 我不确定在 npm 更新之前运行的控件版本。
  4. 我跳回版本 0.15.3 只是因为版本 0.18.5 和 0.18.4 也给了我错误。
  5. 我不知道我是真的在问问题,还是只是想指出 kendo-angular-inputs 组件可能有问题。

【问题讨论】:

  • 忘记包含以下依赖版本:“@angular/common”:“~2.4.0”、“@angular/core”:“~2.4.0”、“@angular/forms” : "~2.4.0", "@progress/kendo-angular-intl": "^0.9.1", "rxjs": "5.0.1", @telerik/kendo-draggable@^1.2.0" @telerik /kendo-inputs-common@^2.1.0"

标签: angular kendo-ui-angular2


【解决方案1】:

@progress/kendo-angular-inputs 软件包有几个更新版本,解决了几个 AOT 问题。

你可以试试0.18.7 (2017-02-10) 版本吗?它至少解决了与私有成员和不匹配的签名类型相关的问题。

【讨论】:

  • 我的 0.18.7 版本的结果:与 0.15.3 版本的结果相同。至少现在我可以 AOT 编译。但是,如果我想再次运行 JIT 版本,我必须删除已编译的文件夹才能使其运行。 1. NPM 启动 - 工作 2. AOT 编译 - 工作 3. NPM 启动 - 错误
  • 这里是错误:aot/node_modules/@progress/kendo-angular-inputs/dist/es/maskedtextbox/maskedtextbox.component.ngfactory.ts(275,35):错误TS2346:提供的参数不匹配调用目标的任何签名。等等……
  • 这听起来绝对是缺少ngOnChanges 参数。尽管如此,这已在0.18.7 中得到解决。它可能是缓存或其他我们无法在本地复制的东西。你能分享一个复制问题的可运行应用程序吗?您可以在github.com/telerik/kendo-angular/issues 中打开一个问题。
猜你喜欢
  • 2017-07-17
  • 2017-05-25
  • 2017-07-21
  • 2016-10-03
  • 1970-01-01
  • 1970-01-01
  • 2023-01-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多