I’m trying to create a list of users using the collection feature in firebase however, I am running into these errors.

Here is the information that I am entering.
Here is my code.
const Signup = () => {
const [err, setErr] = useState(false);
const handleSubmit = async (e) => {
e.preventDefault(); // prevents page reload
const displayName = e.target[0].value;
const email = e.target[1].value;
const password = e.target[2].value;
const profilePic = e.target[3].files[0];
try {
const res = createUserWithEmailAndPassword(auth, email, password);
const storageRef = ref(storage, displayName);
const uploadTask = uploadBytesResumable(storageRef, profilePic);
uploadTask.on(
(error) => {
setErr(true);
},
() => {
getDownloadURL(uploadTask.snapshot.ref).then(
async (downloadURL) => {
await updateProfile(res.user, {
displayName,
photoURL: downloadURL,
});
await setDoc(doc(db, "users", res.user.uid), {
uid: res.user.uid,
displayName,
email,
photoURL: downloadURL,
});
}
);
}
);
} catch (err) {
setErr(true);
}
};
Authentication works perfectly. I just have a problem creating a collection in the cloud firestore.


