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

lum*_*ron 1 typescript ionic-framework ngrx ngrx-effects angular

我正在使用 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.
Run Code Online (Sandbox Code Playgroud)

错误是参考以下代码块:

export declare function isOnRunEffects(sourceInstance: {
    [onRunEffectsKey]?: onRunEffectsFn;
}): sourceInstance is OnRunEffects;
Run Code Online (Sandbox Code Playgroud)

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

感谢任何和所有的帮助,因为我承认这一点很难过。谢谢。

编辑

我正在使用打字稿版本 3.0.1

Mat*_*hen 5

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

  • 您收到的错误文本在 TypeScript 3.0.1 中不存在。您必须在某个地方使用旧版本。你是如何运行应用程序的? (2认同)