New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud function not picking up RTDB emulator when using handler namespace from firebase-functions sdk #2777
Comments
@russellwheatley thanks for filing this, I thought we had this working. @joehan is this a regression with Extensions emulation? |
This looks like it may be a regression - investigating today. |
Looking into this closer, i'm not certain this is a regression. @russellwheatley which emulator commands are you using - To explain a bit further: A Cloud Function consists of a trigger (what makes the function fire) and a handler (what to do when the function fires). The 'normal' namespace (functions.database.ref.onCreate) defines both a trigger and a handler, whereas the handler namespace (functions.handler.database.ref.onCreate) only defines a handler. You CAN use the normal namespace for extensions - however, the trigger defined by the code will be ignored in favor of the trigger defined in extension.yaml. This is a bit confusing, so we use the handler namespace to avoid defining a trigger in the code that will be ignored. Because it doesn't define any triggers in the code, the handler namespace won't work with Even though I don't think this is a regression, its definitely not a very clear experience right now. At the very least, we probably should add some clearer error messages/warnings for when functions defined using the |
I am seeing this error with the i emulators: Starting emulators: functions, pubsub
⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, firestore, database, hosting
⚠ Your requested "node" version "8" doesn't match your global version "12"
⚠ functions: You are not signed in to the Firebase CLI. If you have authorized this machine using gcloud application-default credentials those may be discovered and used to access production services.
⚠ It appears you are running in a CI environment. You can avoid downloading the Pub/Sub Emulator repeatedly by caching the /home/runner/.cache/firebase/emulators directory.
i pubsub: downloading pubsub-emulator-0.1.0.zip...
i pubsub: Pub/Sub Emulator logging to pubsub-debug.log
i functions: Watching "/home/runner/work/<redacted>" for Cloud Functions...
i functions[testPubSub]: function ignored because the pubsub emulator does not exist or is not running.
i Running script: npx mocha --exit tests/test.js
npx: installed 100 in 4.5s
testing...123
0 passing (1ms)
✔ Script exited successfully (code 0)
i emulators: Shutting down emulators.
i functions: Stopping Functions Emulator
i pubsub: Stopping Pub/Sub Emulator
i hub: Stopping emulator hub According to the Emulator shutdown logs the PubSub emulator was running as it was stopped. |
[REQUIRED] Environment info
firebase CLI 8.14.1
firebase-tools:
macOS Catalina 10.15.4
Platform:
[REQUIRED] Test case
I've created a repository for the bug with the steps in the
README.md
file to reproduce: https://github.com/russellwheatley/emulator-extension-issue[REQUIRED] Expected behavior
I expected the cloud function emulator to run with the RTDB emulator when using the handler namespace of the
firebase-functions
sdk (apologies if this is in the wrong repo, not sure whose responsibility this falls under).[REQUIRED] Actual behavior
It doesn't recognise the RTDB emulator. Here is a log from the console:
Let me know if you need more information.
The text was updated successfully, but these errors were encountered: