简体   繁体   中英

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?

在此处输入图像描述

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

The solution for us was enabling the 'TypeScript language service' in the Intellij properties.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM