ngrx / effects中的打字稿错误:计算的属性名称必须引用内置符号

时间:2018-08-23 16:37:26

标签: angular typescript ionic-framework ngrx 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 Effects版本6.1.0。

感谢所有帮助,因为我对此深感困惑。谢谢。

编辑

我正在使用3.0.1版打字稿

1 个答案:

答案 0 :(得分:3)

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