You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the Functions emulator with debug logging: firebase emulators:start --debug
[REQUIRED] Expected behavior
The cloud functions should run as usual if we had a valid .runtimeconfig.json file.
However, if we legitimately don't have the file locally, the emulator should rightly fail with a helpful error message such as below (which versions 10.8.0 and below produce):
...
[warn] ⚠ It looks like you're trying to access functions.config().functions but there is no value there. You can learn more about setting up config here: https://firebase.google.com/docs/functions/local-emulator {"metadata":{"emulator":{"name":"functions"},"message":"It looks like you're trying to access functions.config().functions but there is no value there. You can learn more about setting up config here: https://firebase.google.com/docs/functions/local-emulator"}}
[warn] ⚠ TypeError: Cannot destructure property 'region' of 'functions.config(...).functions' as it is undefined.
at Object.<anonymous> (~/functions/test.js:2:9)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:816:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (~/functions/index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10) {"metadata":{"emulator":{"name":"functions"},"message":"TypeError: Cannot destructure property 'region' of 'functions.config(...).functions' as it is undefined.\n at Object.<anonymous> (~/functions/test.js:2:9)\n at Module._compile (node:internal/modules/cjs/loader:1095:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)\n at Module.load (node:internal/modules/cjs/loader:975:32)\n at Function.Module._load (node:internal/modules/cjs/loader:816:12)\n at Module.require (node:internal/modules/cjs/loader:999:19)\n at require (node:internal/modules/cjs/helpers:93:18)\n at Object.<anonymous> (~/functions/index.js:3:16)\n at Module._compile (node:internal/modules/cjs/loader:1095:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)"}}
[warn] ⚠ We were unable to load your functions code. (see above) {"metadata":{"emulator":{"name":"functions"}}}
...
[REQUIRED] Actual behavior
An error occurs, but the message firebase-debug.log is not as helpful/detailed as in previous versions of the CLI:
...
[error] Error: Failed to load function definition from source: Failed to generate manifest from function source: TypeError: Cannot destructure property 'region' of 'functions.config(...).functions' as it is undefined.
...
The text was updated successfully, but these errors were encountered:
The prior version of the Functions Emulator required monkey patching of the Functions SDK, which no longer works. Technically, we are trying to remove all monkey patching of library code as that ended up being unreliable and difficult to maintain.
I'm moving this FR to Functions SDK where I think it should be supported natively w/o relying on monkey patching.
[REQUIRED] Environment info
firebase-tools: v10.9.0 to v11.8.0
Platform: macOS
[REQUIRED] Test case
On a project that requires
functions.config()
, remove the.runtimeconfig.json
file from the project and run the functions emulator. Based on the official docs at https://firebase.google.com/docs/functions/local-emulator#web-version-9[REQUIRED] Steps to reproduce
test.js
with the following contents:'region' is a sample Functions environment variable whose
firebase functions:config:get
output looks like this:firebase emulators:start --debug
[REQUIRED] Expected behavior
The cloud functions should run as usual if we had a valid
.runtimeconfig.json
file.However, if we legitimately don't have the file locally, the emulator should rightly fail with a helpful error message such as below (which versions 10.8.0 and below produce):
[REQUIRED] Actual behavior
An error occurs, but the message
firebase-debug.log
is not as helpful/detailed as in previous versions of the CLI:The text was updated successfully, but these errors were encountered: