Skip to content

Cannot call scheduled function from emulated functions shell #3490

@jsakas

Description

@jsakas

[REQUIRED] Environment info

firebase-tools: 9.12.1

Platform: macOS Big Sur Version 11.3.1

[REQUIRED] Test case

https://github.com/jsakas/firebase-test-pubsub

I am calling this a bug because I am pretty sure I was using this functionality a few weeks ago. I had actually used the emulators in combination with the functions shell to test a scheduled function. However, some google searching leads me to believe maybe this isn't implemented and I am just confused. Hopefully someone here knows. 😅

[REQUIRED] Steps to reproduce

There are two functions defined: helloWorld and helloPubSub.

cd functions
npm run serve

Calling helloWorld() gives the expected output (function runs)

Calling helloPubSub() gives the following error:

Uncaught FirebaseError: Could not find trigger helloPubSub
    at FunctionsEmulatorShell.getTrigger (/Users/jonsakas/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorShell.js:52:19)
    at FunctionsEmulatorShell.call (/Users/jonsakas/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorShell.js:25:30)
    at LocalFunction._call (/Users/jonsakas/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/localFunction.js:186:29) {
  children: [],
  context: undefined,
  exit: 1,
  original: undefined,
  status: 500
}

[REQUIRED] Expected behavior

The helloPubSub function runs on demand.

[REQUIRED] Actual behavior

See error above.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions