Firebase .httpsCallable 函数总是返回 "Maximum call stack size exceeded"

Firebase .httpsCallable functions always returning "Maximum call stack size exceeded"

我不确定我是否 100% 使用 await 和 promise 链接,但我终其一生都无法理解为什么每次我尝试将数据传递给 httpsCallable 函数时,我都会得到“最大调用堆栈大小” exceeded" 没有调用函数的错误。

我只是想将从 signInWithEmailAndPassword 返回的用户对象传递给我的 httpsCallable 但无法弄清楚如何避免上述错误.任何指针赞赏 <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)
        })

该错误通常意味着您正在尝试序列化具有内部循环引用的对象。您应该尝试的第一件事是 user 以外的任何对象。然后,尝试根据您从 user 中提取的内容来组合一个对象。只是不要传递 user 本身,因为以默认方式序列化可能不安全。