首页 > 解决方案 > ngrx/effects 中的打字稿错误:计算的属性名称必须引用内置符号

问题描述

我正在使用 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

标签: angulartypescriptionic-frameworkngrxngrx-effects

解决方案


根据错误消息,您使用的 TypeScript 版本似乎早于 2.7。请升级到具有新规则的 2.7 或更高版本。


推荐阅读