Search code examples
node.jsangularngrx-storengrx-effects

node modules error: Type parameter 'OT' has a circular constraint


Getting error while run: ng serve

error:

Error: node_modules/@ngrx/effects/src/effect_creator.d.ts:12:43 - error TS2313: Type parameter 'OT' has a circular constraint.

12 }, DT extends DispatchType<C>, OT extends ObservableType<DT, OT>, R extends EffectResult<OT>>(source: () => R & ConditionallyDisallowActionCreator<DT, R>, config?: C): R & CreateEffectMetadata;

how to fix this error?

i tried with

npm install @ngrx/effects@latest @ngrx/store@latest @ngrx/store-devtools@latest rxjs@latest --save

but still got error while run ng serve in angular project! my angular version is: ^17.1.3 and node vesrion 18.19.0


Solution

  • UPDATE: This issue is permanently solved by the new official update of NGRX v17.2.0. Here is the original issue about this: https://github.com/ngrx/platform/issues/4275

    I got exactly the same error, while I worked on the angular update on our project. Finally, it seems like the problem is with the latest Typescript v5.4.2. I just downgraded it to v5.2.2 and it works properly.

    I will do a more detailed investigation later, I just would like to let you know to solve your blocker issue right now.