Skip to content
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

functions:shell not working #1243

Closed
snj33v opened this issue May 7, 2019 · 12 comments · Fixed by #1260
Closed

functions:shell not working #1243

snj33v opened this issue May 7, 2019 · 12 comments · Fixed by #1260

Comments

@snj33v
Copy link

snj33v commented May 7, 2019

[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 https://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 https://localhost:5000/fresh-con/us-central1/helloWorld
even default port is changed to 5001

@snj33v
Copy link
Author

snj33v commented May 7, 2019

#1214

@samtstern
Copy link
Contributor

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

@samtstern samtstern changed the title emulator not working functions:shell not working May 7, 2019
@samtstern
Copy link
Contributor

@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.

@abeisgoat
Copy link
Contributor

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

@geminiyellow
Copy link

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

@Cdik
Copy link

Cdik commented May 8, 2019

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]

@samtstern
Copy link
Contributor

samtstern commented May 8, 2019 via email

@samtstern
Copy link
Contributor

I am working on a fix in #1260.

@Cdik
Copy link

Cdik commented May 9, 2019

I guess this has been fixed with 6.9.1

@samtstern
Copy link
Contributor

samtstern commented May 9, 2019 via email

@illuminist
Copy link

illuminist commented May 15, 2019

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.

@samtstern
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants