Ngrx effects on lower version of typescript doesn't work

天大地大妈咪最大 提交于 2019-12-12 10:07:40

问题


I have an Ionic 3 App where I use ngrx/store and ngrx/effects. But each time I try to run the app it sais this error below:

TypeScript Error A computed property name in a type literal must directly refer to a built- in symbol. ...: Cannot find name 'any'.

which refers to this folder in my node modules node_modules/@ngrx/effects/src/on_run_effect.d.ts

to this block of code below:

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

This can be fix by installing higher version of typescript but as of now currently I am using 2.6.1 but when I upgrade it to a higher version of typescript my app doesn't work on production and even the console.log methods are not working.

here is my ionic info below:

Ionic:

   ionic (Ionic CLI)  : 4.0.0-rc.13 (/home/clifford/.npm-global/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : browser 5.0.4

System:

   Android SDK Tools : 26.1.1
   NodeJS            : v6.12.2 (/usr/local/bin/node)
   npm               : 4.6.1
   OS                : Linux 4.13

Environment:

   ANDROID_HOME : /home/clifford/Android/Sdk

Appreciate if someone could help. Thanks in advance.


回答1:


May be you are using latest version which is internally uses typescript 3.1.x. Please try to downgrade to the specific version (5.2.0) for typescript 2.6.x. and check it.

npm install @ngrx/store@5.2.0 @ngrx/effects@5.2.0 --save


来源:https://stackoverflow.com/questions/53491165/ngrx-effects-on-lower-version-of-typescript-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!