firebase / firebase-admin-node

Firebase Admin Node.js SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
1.62k stars 368 forks source link

Firebase Admin (Nodejs) crashes because of error "A bucket name is needed to use Cloud Storage" #281

Closed tphduy closed 6 years ago

tphduy commented 6 years ago

I am using a Firebase admin in Node.js and I am not going to use Cloud Storage in my own server, firebase app initialization working well before but it crash today because of error "A bucket name is needed to use Cloud Storage". So I tried to integrate cloud storage to fix it but it did not work. const admin = require('firebase-admin') const serviceAccount = require('./letseat-dd347-firebase-adminsdk-op4zs-3ad050a59d.json') admin.initializeApp({ credential: admin.credential.cert(serviceAccount), storageBucket: 'letseat-dd347.appspot.com' })

Environment details

OS: MacOS High Sierra Node.js version: 10.2.1 npm version: 5.6.0 Firebase version: 5.12.1 @google-cloud/storage version: lasted Steps to reproduce

npm install nodemon or node app.js or nom start. => Crashing because of error: A bucket name is needed to use Cloud Storage.

screen shot 2018-05-29 at 6 43 42 pm
google-oss-bot commented 6 years ago

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

google-oss-bot commented 6 years ago

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

hiranya911 commented 6 years ago

What's at routes/restaurant.js line 10?

tphduy commented 6 years ago

This

screen shot 2018-05-30 at 3 27 52 pm

this is my restaurant.js. I don't know why I did not use Cloud Storage on my own server but It still keep crashing?

hiranya911 commented 6 years ago

This is not useful. I expected to see references to admin in your code, but there aren't any in the above file. And interestingly, your stacktrace doesn't have any Admin SDK references either. I think something else in your code is trying to load the Cloud Storage module. Admin SDK doesn't load it unless admin.storage() is invoked explicitly. Can you share the file where Admin SDK is actually used/initialized?

hiranya911 commented 6 years ago

Closing this due to lack of information. Please reopen with a minimal, reproducible test case if you want us to follow up.