React Native Firestore Function Error: RangeError: Maximum call stack size exceeded

Multi tool use
up vote
0
down vote
favorite
I have a firestore function and whenever I call it, it gives me the error mentioned in the title. How do I fix this?
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 }
})
})

add a comment |
up vote
0
down vote
favorite
I have a firestore function and whenever I call it, it gives me the error mentioned in the title. How do I fix this?
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 }
})
})

add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a firestore function and whenever I call it, it gives me the error mentioned in the title. How do I fix this?
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 }
})
})

I have a firestore function and whenever I call it, it gives me the error mentioned in the title. How do I fix this?
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 }
})
})


asked 2 days ago
Vince Gonzales
809
809
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
draft saved
draft discarded
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53183835%2freact-native-firestore-function-error-rangeerror-maximum-call-stack-size-excee%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
8MNLRWnIzEbae190Fri,cj8bSVM HEarRy3jhw,TDMKp,KbWK7J4WfR38hEc