Angular async pipe error: Argument of type 'any[] | null' is not assignable to parameter of type 'any[]'

Angular async pipe error: Argument of type 'any[] | null' is not assignable to parameter of type 'any[]'

我在 *ngFor 中的 Angular 中使用管道异步时遇到了这个问题。这是我的代码:

<ul>
    <li *ngFor="let user of users | async | search:(filterValue | async)!">{{ user.name }}</li>
</ul>

我收到错误消息:

Argument of type  'any[] | null' is not assignable to parameter of type 'any[]'.
  Type 'null' is not assignable to type 'any[]'.

我可以通过使用“!”修复 de search 管道中的最后一个异步。因为我知道它永远不会为空,但我无法对第一个管道做同样的事情,我知道它也永远不会为空,我怎么能使用“!”也有吗?

我已经试过用括号括起来并加上“!”在它上面,但它停止识别用户 属性 让用户使用

你试过吗?我认为这应该有效。

<li *ngFor="let user of (users | async)! | search:(filterValue | async)!">