Open ShrawanBK opened 5 years ago
same issue
explicitly add the storage bucket in the admin initialization
I had the same problem. I didnt specify my collection correctly. So a did this: Change this
.then(() => {
const imageUrl = `https://firebasestorage.googleapis.com/v0/b/${config.storageBucket}/o/${imageFileName}?alt=media`;
return admin.firestore().doc(`/users/${req.user.handle`).update({ imageUrl });
})
for this
.then(() => {
const imageUrl = `https://firebasestorage.googleapis.com/v0/b/${config.storageBucket}/o/${imageFileName}?alt=media`;
return admin.firestore().collection('users').doc(`${req.user.handle}`).update({ imageUrl });
})
I hope my answer helps anyone 🤓
Same issue, I get Internal Server Error in Postman. @davigsa fix did not work for me. On admin, also added the specific storage bucket as some other users have suggested (.bucket(${config.storageBucket}
). No luck there either. Any ideas?
I get this error on image upload:
TypeError: Cannot read property 'handle' of undefined in this line:
return admin.firestore().doc(/users/${req.user.handle
).update({ imageUrl });
The code shows console log until busboy.on('file') but not in busboy.on('finish'). Help needed !!