【问题标题】:Typescript error in ngrx/effects: computed property name must refer to a built in symbolngrx/effects 中的打字稿错误:计算的属性名称必须引用内置符号
【发布时间】:2019-01-30 02:40:45
【问题描述】:

我正在使用 ngrx 在我的 ionic 3.9.2 应用程序中实现应用程序状态(使用本教程作为指导:https://gonehybrid.com/a-beginners-guide-to-using-ngrx-in-an-ionic-2-app-part-1/

当我尝试运行应用程序时,我目前收到此错误:

typescript: ...foo/bar/node_modules/@ngrx/effects/src/on_run_effects.d.ts, line: 9
A computed property name in a type literal must directly refer to a built-in symbol.

错误与以下代码块有关:

export declare function isOnRunEffects(sourceInstance: {
    [onRunEffectsKey]?: onRunEffectsFn;
}): sourceInstance is OnRunEffects;

我正在使用 ngrx 效果器 6.1.0 版。

感谢任何和所有的帮助,因为我承认对此感到很困惑。谢谢。

编辑

我使用的是打字稿版本 3.0.1

【问题讨论】:

    标签: angular typescript ionic-framework ngrx ngrx-effects


    【解决方案1】:

    根据错误消息,您使用的 TypeScript 版本似乎早于 2.7。请升级到 2.7 或更高版本,has new rules

    【讨论】:

    • 我使用的是 typescript 3.0.1 版,我会更新问题以反映这一点
    • TypeScript 3.0.1 中不存在您收到的错误文本。您必须在某个地方使用旧版本。你是如何运行应用程序的?
    • 你是对的!我的本地打字稿版本是 2.6.2,升级它解决了这个问题。非常感谢!
    猜你喜欢
    • 2017-10-21
    • 1970-01-01
    • 2021-08-31
    • 2017-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    相关资源
    最近更新 更多