Argument of type ‘unknown\[\



initialize() method says

Argument of type ‘unknown[]’ is not assignable to parameter of type ‘OperatorFunction‘. Type ‘unknown[]’ provides no match for the signature ‘(source: Observable): Observable’

alertsChanged$: Observable<AlertModel[]>;

private initialize(): void {

    this.alertsChanged$  this.alertsService.getAlerts().pipe(
      map((res) > res), // here it returns the above error
      tap((res) > {

        this.setDataForFilters(res); //Argument of type 'unknown' is not assignable to parameter of type 'AlertModel[]'.  


 private setDataForFilters(alerts: AlertModel[]): void {}


 // no issues here

 getAlerts(): Observable<AlertModel[]> {
      return this.angularFireDatabase
        map((res) > orderBy(res, ['timeStamp'], ['desc'])),


    [alerts]"alertsChanged$ | async"

Please let me the issue here?


I found the issue here. It was a conflict with the Lodash map and RxJS map. i.e. VS code didn’t import the RxJS map due to the Lodash map and it gave the above error due to that.

Since I need to use both on the same component I have done it like so.

import { finalize, tap, map } from 'rxjs/operators';

import { map as lodashMap } from 'lodash';

Answered By – Sampath

Leave a Comment