-
Notifications
You must be signed in to change notification settings - Fork 956
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
Firebase functions emulator ignores region #3031
Comments
@JaapWeijland I am not able to reproduce this behavior. Here are my two functions: const functions = require("firebase-functions");
exports.helloWorld = functions.https.onRequest((req,res) => {
res.send("Hello, America\n");
});
exports.helloEurope = functions.region('europe-west3').https.onRequest((req, res) => {
res.send("Hello, Europe\n");
}); When I run
I am able to
Is there more to your situation? Do you possibly have two functions with the same name in different regions? If so that's a known limitation of the emulator right now. |
Thanks for your answer! I oversimplified my example a bit. What I actually have, is the following:
I deliberately left the comments there. As you see, I'm experimenting with NestJS on Firebase. If filtered the issue down to be associated with Express though, so I'm not sure if NestJS has to do with anything here. As you see, I gave the Express server to the endpoint to handle the traffic. For testing purposes, I added a regular signature to another endpoint. the So, I think it has something to do with Express. Edit: My compiled JS looks like this:
|
@JaapWeijland ah that helps thanks! I was able to roll a fix into this PR I was already working on: |
@JaapWeijland can you show me the smallest test case that reproduces the issue on the latest version? |
Ha Sam, I already deleted my comment. I was still using the old version when I thought I installed the newer one. I can confirm that latest version fixes the issue. |
@JaapWeijland oh thank you! I use GitHub through my email mostly so I didn't notice it was deleted. Appreciate the super fast reply. |
This is still happening to me i have tried
and
For some reason emulator always runs with us-central1 |
[REQUIRED] Environment info
firebase-tools:
9.2.0
Platform:
macOS
[REQUIRED] Test case
export const api = region('europe-west3').https.onRequest(server);
When starting the emulator, the emulator correctly outputs the following URL:
✔ functions[api]: http function initialized (http://localhost:5000/**[some-project]**/europe-west3/api).
However, when visiting that URL, a 404 is given. Going to the following URL works however:
http://localhost:5000/**[some-project]**/us-central1/api
[REQUIRED] Steps to reproduce
See above
[REQUIRED] Expected behavior
Hitting the
europe-west3
URL working like theus-central1
version does.[REQUIRED] Actual behavior
The
europe-west3
version hits a 404, whileus-central1
works.The text was updated successfully, but these errors were encountered: