firebase-tools:6.9.2
firebase functions:shell
The functions are firebase functions in the following format:
exports.helloPubSub = functions.pubsub.topic('topic-name').onPublish((message) => {
// ...
});
They are emulated using the following:
firebase functions:shell
I am expecting that all functions are being emulated
The shell is completely broken right now but we have a fix coming in #1260 (original issue is #1243).
For now please downgrade your CLI to version 6.8.0 and it will work.
Closing as a duplicate of #1243
Thank Sam. I downgraded to 6.8.0 again but now I get the following error where it used to work previously. Any Ideas what might cause this:
Error: EPERM: operation not permitted, rename 'C:\Users\ljcremer.configconfigstore\firebase-tools.json.2572117863' -> 'C:\Users\ljcremer.configconfigstore\firebase-tools.json'
at Object.fs.renameSync (fs.js:766:18)
at Function.writeFileSync [as sync] (C:\Users\ljcremer\Google Drive\Development\TroopTravel\v2019.1\firebase-cloud-functions-nodejs\functions\node_modulesconfigstore\node_modules\write-file-atomic\index.js:124:8)
at Configstore.set (C:\Users\ljcremer\Google Drive\Development\TroopTravel\v2019.1\firebase-cloud-functions-nodejs\functions\node_modulesconfigstore\index.js:62:21)
at new Configstore (C:\Users\ljcremer\Google Drive\Development\TroopTravel\v2019.1\firebase-cloud-functions-nodejs\functions\node_modulesconfigstore\index.js:27:11)
at Object.
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.
at Module._compile (module.js:653:30)]
! functions: Error from emulator. [object Object]
No functions emulated.
Hi this is not related to the referenced issue I am getting with 6.10.0 :
(node:23119) ExperimentalWarning: The fs.promises API is experimental
✔ functions: Using node@10 from host.
✔ functions: Emulator started at http://localhost:5000
i functions: Watching "/Users/dimtrioskanellopoulos/Projects/track-tools/functions" for Cloud Functions...
i Your code has been provided a "firebase-admin" instance.
i functions: HTTP trigger initialized at http://localhost:5000/quantified-self-io/europe-west2/stWorkoutDownloadAsFit
i functions: HTTP trigger initialized at http://localhost:5000/quantified-self-io/us-central1/authRedirect
i functions: HTTP trigger initialized at http://localhost:5000/quantified-self-io/us-central1/authToken
Ignoring trigger "scheduledFunction" because the service "pubsub.googleapis.com" is not yet supported.
why Ignoring trigger ?
@jimmykane I assume that output is from firebase emulators:start? That's working as intended right now. There is no way for us to "emulate" a PubSub function in a way that would be useful, since it will never be triggered by any other emulator.
Right now we support:
In the future we definitely want to add support for pubsub though!
@samtstern Oh ok. I thought that due to the title of this ticket that was the issue. Sorry then it looks ok I can trigger that via the shell
@jimmykane I assume that output is from
firebase emulators:start? That's working as intended right now. There is no way for us to "emulate" a PubSub function in a way that would be useful, since it will never be triggered by any other emulator.Right now we support:
- Firestore functions
- HTTP functions (including callable)
In the future we definitely want to add support for pubsub though!
So I guess this is the same issue with using auth binds? ATM I was trying to setup a trigger on user created but I get the same message but with "firebaseauth.googleapis.com". Is this also planned soon? Is there another way to test locally functions that require auth services?
Also, what's the difference between firebase serve and emulators? Because with serve the exact same error happens.
Is this also planned soon? Is there another way to test locally functions that require auth services?
In the future we would like to add more emulators, such as auth and PubSub, which would allow us to emulate those triggers. But this is a lot of work, so I would not say it's coming soon.
Is there another way to test locally functions that require auth services?
functions:shell works for any trigger type but you have to manually invoke it with data. You can also use the firebase-functions-test library to write unit tests.
Also, what's the difference between firebase serve and emulators? Because with serve the exact same error happens.
The biggest difference is how the functions emulator behaves. We will clarify this in the future and deduplicate some of the functionality.
Most helpful comment
@jimmykane I assume that output is from
firebase emulators:start? That's working as intended right now. There is no way for us to "emulate" a PubSub function in a way that would be useful, since it will never be triggered by any other emulator.Right now we support:
In the future we definitely want to add support for pubsub though!