Can not read "functions.config()" with`firebase serve`
See original GitHub issueOS: 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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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)Ah, here’s the issue: https://github.com/firebase/firebase-tools/issues/1774