Q:

InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' but console gives Observable?

I'm pretty new to firebase and rxjs but this still doesn't get in my head:
I make a simple query to my firestore database via a Service
chat.service.ts:
chatsCollection: AngularFirestoreCollection<Chat>;
  chats: Observable<Chat[]>;

  constructor(private db: AngularFirestore) {
  }

  getChats(): Observable<Chat[]> {
    this.chatsCollection = this.db.collection('chats');
    return this.chatsCollection.valueChanges();
  }

chat.component.ts:
  chats: Observable<Chat[]>;
  constructor(private router: Router, public chatService: ChatService) { }

  ngOnInit() {
    this.chats = this.chatService.getChats();
    console.log(this.chats);
  }

chat.component.html:
<mat-card class="example-card">
  <mat-card-header>
    <mat-card-title>Your Chats</mat-card-title>
  </mat-card-header>
  <mat-card-content>
    <mat-selection-list #chats>
      <h3 mat-subheader>Chats</h3>
      <mat-list-option *ngFor="let chat of (chats | async)" (click)="handleClick(chats)" [value]="chat.id">
        <img matListAvatar src="./assets/avatar.svg" alt="Avatar Icon">
        <h3 mat-line>{{chat.name}}</h3>
        <p mat-line>test</p>
      </mat-list-option>
    </mat-selection-list>
  </mat-card-content>
</mat-card>

Now the problem is the async pipe throws an error for getting an object instead of an observable, but I log it before and it says it's an observable? Also if I subscribe to it (for test) it returns my values I want.

Thanks for help in advance!
Versions used:
rxjs: 6.3.3
Angular7
firebase: 5.5.6

A:

The problem is the #chats on the mat-selection-list. It's overwriting your components chats variable inside the template. Rename that one to something else, and you are good to go.
<mat-selection-list #chatList>

