Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`firebase deploy` with CLI tools 3.17.0 gives "Error: Firebase config variables are not available"

Full error dump:

Error: Error occurred while parsing your function triggers. Please ensure you have the latest firebase-functions SDK by running "npm i --save firebase-functions@latest" inside your functions folder.

Error: Firebase config variables are not available. Please use the latest version of the Firebase CLI to deploy this function.
    at init (/Users/dougstevenson/work/google/firebase/functions/tmp/functions/node_modules/firebase-functions/lib/config.js:51:15)
    at Object.config (/Users/dougstevenson/work/google/firebase/functions/tmp/functions/node_modules/firebase-functions/lib/config.js:29:9)
    at Object.ref (/Users/dougstevenson/work/google/firebase/functions/tmp/functions/node_modules/firebase-functions/lib/providers/database.js:75:33)
    at Object.<anonymous> (/Users/dougstevenson/work/google/firebase/functions/tmp/functions/lib/index.js:9:32)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
like image 379
Doug Stevenson Avatar asked Jan 18 '18 19:01

Doug Stevenson


1 Answers

With firebase-tools (the Firebase CLI) version 3.17.0, it's required to use the latest firebase-functions (version 0.8.1) and firebase-admin (version 5.8.1) SDKs. Update them by running this command from the functions folder:

npm install firebase-functions@latest firebase-admin@latest

After this, a deploy should succeed.

EDIT: This bug was fixed in CLI version 3.17.1. A similar bug appears also when running the emulator with the CLI, and that was fixed in 3.17.3.

like image 200
Doug Stevenson Avatar answered Sep 30 '22 05:09

Doug Stevenson