首页 > 解决方案 > Webstorm 无法识别我的ngrx/效果

问题描述

此效果正常运行,但 webstorm 似乎无法识别它。

  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})))
        );
      })
    ));

错误信息是:

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>>>) 

有谁知道这意味着什么以及如何解决它?

在此处输入图像描述

标签: angularngrx-effects

解决方案


我有同样的问题,删除 node_modules 并重新安装所有节点包为我解决了这个问题。


推荐阅读