Property ‘createId’ does not exist on type

This error generally comes when you upgrade your angular fire and firebase to the latest version.

 data['id']=this.createId();

For the new Firebase 9 you need to do the following change.

 data['id']=firebase.firestore().collection("Forum").doc().id

Also update your angular fire import. Also match the angular fire and firebase version if you are at firebase 9

"@angular/fire": "~7.0.4",
"firebase": "~9.0.2",
import { AngularFireModule } from "@angular/fire/compat";
import { AngularFireAuthModule } from "@angular/fire/compat/auth";
import { AngularFireStorageModule } from '@angular/fire/compat/storage';
import { AngularFirestoreModule } from '@angular/fire/compat/firestore';
import { AngularFireDatabaseModule } from '@angular/fire/compat/database';

Leave a Reply

Your email address will not be published.