问题
I have an ionic app trying to update the records in firebase. I keep on getting this error. Not sure what I am doing wrong.
Error: Uncaught (in promise): FirebaseError: [code=invalid-argument]: Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: a custom Object object
FirebaseError: Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: a custom Object object
this is my update function.
updateTodo(todo: Todo, id: string) {
return this.todosCollection.doc(id).update(todo)
}
回答1:
This happens when you are trying to send an empty object to firebase. I had this error when I reset my form values before the async call could finish..
来源:https://stackoverflow.com/questions/57503465/collectionreference-doc-requires-its-first-argument-to-be-of-type-non-empty-st