问题
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