I've been developing an Express/Firebase application for a few weeks now. All has worked fine until I ran into the following issue:
TypeError: firebase.storage is not a function
A quick search led me to TypeError: firebase.storage is not a function. So using the solution gathered there, I configured @google-cloud/storage
succesffuly. But then, I ran into:
Caller does not have storage.objects.create access to bucket example.appspot.com
After some more googling I learned that I must manually add my firebase-admin user to the example.appspot.com
bucket on https://console.cloud.google.com/storage/
Once that's done I test the following:
bucket.upload('./package.json')
.then((file) => {
console.log(file)
})
.catch((error) => {
console.log(error)
})
This works perfectly. The issue arises when I stop the Express app and rerun it to try to do the upload again which results in Caller does not have...
error again. Checking the bucket permissions, I see that the user I added previously is now gone:
I don't know if I'm missing something here, a bug in the @google-cloud/storage
package, or a bug somewhere else. Any ideas?