I'm not sure I'm 100% on await and promise chaining, but I cannot for the life of me understand why any time I try to pass data to a httpsCallable function I get a "Maximum call stack size exceeded" error without the function ever being called.
I'm just trying to pass the user object returned from signInWithEmailAndPassword to my httpsCallable but cannot figure out how to without said error. Any pointers appreciated <3
const importFirebase = () => import(process.env.VUE_APP_MODE === 'web' ?
'firebase' : 'nativescript-plugin-firebase/app')
const firebase = await importFirebase()
firebase
.auth()
.signInWithEmailAndPassword(signInData.email, signInData.password)
.then((user) => {
return firebase.functions().httpsCallable('doSomething')(user)
})
The error typically means you're trying to serialize an object with internal circular references. The first thing you should try is any object other than user
. Then, try composing an object based on what you pull out of user
. Just don't pass user
itself, since it might not be safe to serialize in the default manner.