3
에 유형 ([객체 정의되지 않은]) 인코딩 할 수 없을 때 "정의되지 않은 객체"오류 : 나는 경우 FireStore에서 사용자 세부 사항을 추가 할 경우 FireStore 값
기능에 대해 콘솔에서이 오류가 새로운 사용자 가입 한하지만 메신저 :
exports.storeUserData = functions.auth.user().onCreate(event =>{
const user = event.data;
var db_uid_user = db_firestore.collection('users').doc(user.uid).set({
'name' : user.displayName,
'email': user.email,
'phoneNumber': user.phoneNumber,
'photoUrl': user.photoURL
});
console.log('User Add (uid)',user.uid);
});
ERROR : 그래서, 내가 잊고
Error: Cannot encode type ([object Undefined]) to a Firestore Value
at Function.encodeValue (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/document.js:658:11)
at Function.encodeFields (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/document.js:530:36)
at WriteBatch.set (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/write-batch.js:254:35)
at DocumentReference.set (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/reference.js:416:8)
at exports.storeUserData.functions.auth.user.onCreate.event (/user_code/index.js:15:71)
at Object.<anonymous> (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:59:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:53:36)