1

Hi i am having firebase cloud functions, When i run firebase emulator in local they are not displaying in emulator.below is my functions code

const functions = require("firebase-functions");
const admin = require("firebase-admin");
const DomParser = require('dom-parser')

admin.initializeApp(functions.config().firebase);

exports.storeBooking = functions
  .region("europe-west1")
  .pubsub.topic("responses")
  .onPublish((message) => {
/// some logic
  });

when i run emulator must show function storeBooking, But in emulator it is showing as below

Watching "D:\backend-functions\booking" for Cloud Functions...
function ignored because the pubsub emulator does not exist or is not running.
function ignored because the pubsub emulator does not exist or is not running.
Sudhir
  • 1
  • 1
  • 9
  • 24

1 Answers1

1

The emulator will show like this:

Watching "D:\backend-functions\booking" for Cloud Functions…
function ignored because the pubsub emulator does not exist or is not running.
function ignored because the pubsub emulator does not exist or is not running.

Which means function was found but for some reason firebase cannot connect to pubsub emulator, despite all the configs.

As per the documentation, you need to set up admin credentials to test your functions to interact with Google APIs or other Firebase APIs via the Firebase Admin SDK.

The cloud pubsub requires the setup steps described in this section. This applies whether you're using the Cloud Functions shell or firebase emulators:start.

You can follow the instructions To set up admin credentials for emulated functions from documentation.

For more information you can check with this Stackoverflow Link.