firebaseError : Function CollectionReference.doc()requires its first argument to be of type non-empty string, but it was : "" code example
Example: Unhandled Rejection (FirebaseError): Function Firestore.collection() cannot be called with an empty path.
Add condition if parameter exists
if (id) {
...
}