【问题标题】:Angular build error in core/src/render3/interfacescore/src/render3/interfaces 中的角度构建错误
【发布时间】:2018-09-06 19:13:04
【问题描述】:

在构建 Angular 6 应用程序时,我在第 35 行的 @angular/core/src/render3/interfaces 中遇到编译错误。该行是:

   [ACTIVE_INDEX]: number | null;

错误是: error TS1169: A computed property name in an interface must directly refer to a built-in symbol.

我使用@angular/core@6.1.6。我做错了什么还是这是一个 Angular 错误?

【问题讨论】:

    标签: visual-studio-2017 angular6


    【解决方案1】:

    验证 Visual Studio is targeting the correct version of Typescript(如您的 package.json 中所示),然后尝试删除您的 node_modules 文件夹,然后重新运行 npm install

    我相信这是由于使用早期不兼容的打字稿版本(container.d.ts 文件(在您的错误中引用)使用的能力来使用 Typescript 2.7 中添加了常量命名属性。当然,如果就这么简单,那么 ng serve 会告诉你 Typescript 不兼容,所以我假设我错了,或者你的环境在欺骗你。

    See here for a related question.

    【讨论】:

      猜你喜欢
      • 2019-08-13
      • 2017-12-01
      • 2019-01-12
      • 2019-01-28
      • 2019-01-05
      • 2015-06-09
      • 1970-01-01
      • 2022-07-08
      • 2023-01-26
      相关资源
      最近更新 更多