question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not read "functions.config()" with`firebase serve`

See original GitHub issue

OS: macOS Sierra v10.12.6

Version info

  • firebase-tools: v4.2.1
"firebase-admin": "6.0.0",
"firebase-functions": "2.0.5",

firebase-functions:

Test case

  • I set the environment configs firebase functions:config:set mockservice.value="something"
  • I check that they were set firebase functions:config:get
    • results
{
  "mockservice": {
    "value": "something"
  }
}

Actual behavior

  • When I run firebase serve with " functions.config()" in my code they always come up empty.

I checked both past issues (264, 282) and stackoverflow nobody seems to be having problems getting env configs locally.

I’ve deleted and re-installed node_modules, uninstalled and reinstalled firebase-tools and now I’ve resorted to a hacky workaround. Any help would be greatly appreciated. Thanks in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
laurenzlongcommented, Oct 5, 2018

The file has to be named .runtimeconfig.json, anything else won’t work. As well, if you are on Windows Powershell, you need to run: firebase functions:config:get | ac .runtimeconfig.json (This is documented in https://firebase.google.com/docs/functions/local-emulator)

0reactions
alexandervlplcommented, Feb 27, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Cloud Functions locally gives error "functions.config ...
I get this error. Error: functions.config() is not available. Please use the latest version of the Firebase ...
Read more >
Configure your environment | Cloud Functions for Firebase
Runtime environment configuration with the Firebase CLI and functions.config . For most use cases, parameterized configuration is recommended.
Read more >
Working with Firebase Functions — HTTP Request - ITNEXT
The function is trigger by calling it directly from the browser, methods or using a HTTP service. There is a very good article...
Read more >
Server-side code with Firebase Functions - Pragmatists
Last time, we discussed setting up hosting, firestore and ... 4 min read ... Firebase Cloud Functions allow you to do just that....
Read more >
Email Notifications With Firebase Cloud Functions
3 min read ... So for this tutorial we will use Nodemailer with Gmail. ... const gmailPassword = functions.config().gmail.password; // Create the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found