Functions-samples: Error: functions.config() is not available

Created on 21 Aug 2017  路  6Comments  路  Source: firebase/functions-samples

Hi!
big thank for this great sample!
i did npm install in all src, function and root of project, but
sudo firebase serve --only hosting,functions

FirebaseError: Error occurred while parsing your function triggers.

Error: functions.config() is not available. Please use the latest version of the Firebase CLI to deploy this function.
    at init (/home/valaoffice/functions-samples/isomorphic-react-app/functions/node_modules/firebase-functions/lib/config.js:46:19)
    at Object.config (/home/orloff/functions-samples/isomorphic-react-app/functions/node_modules/firebase-functions/lib/config.js:29:9)
    at Object.<anonymous> (/home/orloff/functions-samples/isomorphic-react-app/functions/index.js:28:29)
    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)
    at require (internal/module.js:20:19)

Most helpful comment

It needs to be at least v0.5.7 for config to be emulated properly. Filed https://github.com/firebase/functions-samples/issues/219 for the samples to be updated so they will work right away after cloning.

In the meanwhile, you can run this command inside the functions folder:

npm install --save firebase-functions@latest

All 6 comments

What's your firebase-functions and firebase-tools versions respectively? And which sample are you talking about?

sorry,
isomorphic-react-app,
[email protected]
@google-cloud/[email protected]

when you look in functions/package.json, what does the version number next to firebase-functions say?

It needs to be at least v0.5.7 for config to be emulated properly. Filed https://github.com/firebase/functions-samples/issues/219 for the samples to be updated so they will work right away after cloning.

In the meanwhile, you can run this command inside the functions folder:

npm install --save firebase-functions@latest

Yes, after upgrade to
"firebase-functions": "^0.6.2"
it works properly!
Thanks!

Thanks for the update!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rodrigosol picture rodrigosol  路  3Comments

Qzingo picture Qzingo  路  3Comments

blaforet picture blaforet  路  3Comments

motss picture motss  路  4Comments

beratuslu picture beratuslu  路  4Comments