我有一个firestore函数,每当我调用它时,它就会给我标题中提到的错误。我该如何解决?
exports.retrieveCurrentUser = functions.https.onCall((data, context) => {
let usersRef = admin.firestore().collection('tblusers')
let user = data.user
return usersRef.doc(user.uid).once('value').then((userData) => {
let userFetchedData = userData.data()
// user found
if (typeof userFetchedData !== 'undefined') {
return { userFirestoreData: userFetchedData }
} else {
return { userFirestoreData: false }
}
}, error => {
console.log(error)
return { userFirestoreData: false }
})
})