Firebase-tools: functions:shell not working

Created on 7 May 2019  Â·  12Comments  Â·  Source: firebase/firebase-tools

[REQUIRED] Environment info


firebase-tools: 6.9.0


Platform: Linux

[REQUIRED] Test case


works on default project from firebase init functions

[REQUIRED] Steps to reproduce


same as mentioned in docs, for explantion i'm using firebase functions:shell

[REQUIRED] Expected behavior

i  functions: Preparing to emulate functions.
✔  functions: helloWorld
firebase > helloWorld
{ [Function]
  get: [Function],
  head: [Function],
  post: [Function],
  put: [Function],
  patch: [Function],
  del: [Function],
  delete: [Function],
  cookie: [Function],
  jar: [Function],
  defaults: [Function] }

[REQUIRED] Actual behavior

✔  functions: Emulator running at http://localhost:5001
firebase > helloWorld
ReferenceError: helloWorld is not defined

Note

this works on 6.8.0 though
new version(6.9.0) does not display url too http://localhost:5000/fresh-con/us-central1/helloWorld
even default port is changed to 5001

emulator-suite bug

Most helpful comment

Investigating now, in the meantime feel free to continue your work with npm install [email protected]

All 12 comments

1214

@snj33v thanks it looks like we broke something with the new Functions emulator we introduced in 6.9.0. We'll investigate ASAP.

@abehaskins functions:shell has this code block:

      _.forEach(emulator.triggers, function(trigger) {
        if (_.includes(emulator.emulatedFunctions, trigger.name)) {
          var localFunction = new LocalFunction(trigger, emulator.urls, emulator.controller);
          var triggerNameDotNotation = trigger.name.replace(/\-/g, ".");
          _.set(replServer.context, triggerNameDotNotation, localFunction.call);
        }
      });

But I don't think the FunctionsEmulator object exposes any of those trigger fields it's looking for.

Investigating now, in the meantime feel free to continue your work with npm install [email protected]

woo, i upgrade firebase-tools and everything is down. got. please fix it.

Same here.
I don't know if it's linked but I also noticed that installing the latest firebase-tools throw an error regarding [email protected] which isn't thrown with [email protected]

If you're using functions:shell please downgrade to 6.8.0 and we will let
you know when we have a fix. Sorry about the disruption!

I am working on a fix in #1260.

I guess this has been fixed with 6.9.1

Sorry but the fix for this issue wasn't ready for 6.9.1, hoping for the
next release.

~As of 6.9.2 this issue has been fixed.~

As of 6.9.2, the shell is able to find exported function but doesn't available inside the shell as before. And need to be invoke using cURL. Also background trigger functions could not be emulate.

This has been fixed in #1260 and will be part of the next release.

Was this page helpful?
0 / 5 - 0 ratings