Search code examples
angularngrx-effects

Webstorm does not recognize my ngrx/effect


This effect functions correctly, but webstorm seems to be unable to recognize it.

  sendUserName$ = createEffect(() =>
    this.actions$.pipe(
      ofType(sendUserName),
      map((action) => {
        return this.usernameService.SearchUserName(action.username).pipe(
          map((result) => of(sendUserNameSuccess({found: result.found}))),
          catchError((error: HttpErrorResponse) => of(sendUserNameFail({error: error.message})))
        );
      })
    ));

The error message is:

Argument type () => Observable<Observable<({error: string} & TypedAction<"[app] Send user name failed">) | Observable<{found: boolean} & TypedAction<"[app] Send user name success">>>> is not assignable to parameter type () => (EffectResult<ObservableType<DispatchType<EffectConfig>, OT>> & ConditionallyDisallowActionCreator<DispatchType<EffectConfig>, EffectResult<ObservableType<DispatchType<EffectConfig>, OT>>>) 

Does anyone know what this means and how to resolve it?

enter image description here


Solution

  • I had the same problem, removing node_modules and reinstalling all node packages resolved it for me.