-2

I've updated one of my cloud functions and I want to test it on local before I publish it to live and I'm using firebase emulators:start to run the functions and it works without any error but my new code doesn't work.

Ex;

The old code: console.log('before')

The new code: console.log('then')

and when I trigger the functions it prints before.

I've read the doc but couldn't find anything useful. Is there something that I'm missing to run my updated code? My NodeJS version is 10 and I'm using RXJS. Any help/idea would be useful. Thank you...

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
tpbafk
  • 501
  • 5
  • 26
  • Please edit the question to provide the complete code of the function, and the specific steps you take to reproduce this behavior. Anyone should be able to take what you show here, and observe the same thing. – Doug Stevenson Aug 13 '20 at 19:46
  • I haven't added the full function cuz it's not understandable without its dependencies and there's a lot of dependencies. Also, my example(`console.log()`) defines the problem exactly. My updated code is not working. Is there a cache mechanism or something? – tpbafk Aug 13 '20 at 19:50
  • 1
    OK, so, the first thing you should do is boil your code down to a [complete, minimal example](https://stackoverflow.com/help/minimal-reproducible-example) that anyone can use, which is expected on Stack Overflow. The steps you follow to reproduce are just as important. – Doug Stevenson Aug 13 '20 at 19:53
  • Shame on me :'/ I had to build it first. But JS is an interpreted language. Why should I build it? – tpbafk Aug 13 '20 at 19:59
  • 2
    So, if your first question is figured out, and you have a different question, please edit the original to explain the behavior you're seeing that's confusing to you. When you say "Why should I build it", what exactly do you mean? What are you doing that you don't think you should have to do? – Doug Stevenson Aug 13 '20 at 20:05
  • Also if the original question is solved you can share the solution, and for the new question you can open a new question in Stack overflow, as this will help to keep questions and answers organized. – Soni Sol Aug 13 '20 at 21:23

1 Answers1

1

The solution is building. I need to build the code before I execute it. So, I run npm run build && firebase emulators:start and it worked.

tpbafk
  • 501
  • 5
  • 26