0

I am working on google firebase functions to generate thumbnails for images using imagemagic, I did exactly what is mentioned in this link and also I have gone through this link.

I am getting the following exception while deploying using gcloud app deploy command. I have gone through other SO posts(link) which are similar to this issue.

I also have updated firebase tools using (npm install -g firebase-tools). is anything else I am missing ?

In the exception is says at Object. (/app/lib/functions.js:43:47) at line number 43 the code snippet looks like this

exports.generateThumbnail = functions.storage.object().onChange(event => {

Exception looks as follows

Updating service [default]...failed.                                                                                                                    
ERROR: (gcloud.app.deploy) Error Response: [9] 
Application startup error:

> nodejs-getting-started@1.0.0 start /app
> node app.js

/app/node_modules/firebase-functions/lib/config.js:51
        throw new Error('Firebase config variables are not available. ' +
        ^

Error: Firebase config variables are not available. Please use the latest version of the Firebase CLI to deploy this function.
    at init (/app/node_modules/firebase-functions/lib/config.js:51:15)
    at Object.config (/app/node_modules/firebase-functions/lib/config.js:29:9)
    at Object.object (/app/node_modules/firebase-functions/lib/providers/storage.js:41:27)
    at Object.<anonymous> (/app/lib/functions.js:43:47)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! nodejs-getting-started@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nodejs-getting-started@1.0.0 start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodejs-getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs nodejs-getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls nodejs-getting-started
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Sadanand
  • 1,080
  • 3
  • 13
  • 30
  • 3
    So you're using gcloud to deploy instead of the Firebase CLI? The CLI is the main reason why you'd install the firebase-tools package. – Doug Stevenson Jul 06 '17 at 05:48
  • @DougStevenson I have an app engine in my gcloud project, how to deploy to that app engine using firebase cli ? – Sadanand Jul 06 '17 at 11:23
  • @DougStevenson I got it, I have to use firebase init and firebase deploy --only functions to deploy functions ... ref - https://firebase.google.com/docs/cli/ – Sadanand Jul 06 '17 at 11:35

0 Answers0