firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Functions emulator only works in default us-central region

Open piuccio opened this issue 8 years ago • 5 comments

Version info

6.0.1

Platform Information

Mac (Mojave)

Steps to reproduce

const functions = require('firebase-functions');
exports.here = functions.https.onRequest((res) => res.ok());
exports.there = functions.region('asia-northeast1').https.onRequest((res) => res.ok());
firebase serve --only functions

creates the following endpoints

✔  functions: there: http://localhost:5000/my-project/us-central1/there
✔  functions: here: http://localhost:5000/my-project/us-central1/here

Both of them contains us-central1

Expected behavior

I'm expecting that one of them contains asia-northeast1 instead of us-central1 in the path.

Actual behavior

It's not a big deal but it got me confused, I wasn't sure multi region was actually working until I eventually deployed the functions. Once deployed to production the function name contains asia-northeast1.

I see it as a very low priority, I don't mind if you guys want to close it as won't fix but I just wanted to leave a record of it for others that might be confused.

piuccio avatar Nov 16 '18 05:11 piuccio

Personally, I think you're right. If you have a region specified, maybe we should be using that region in the URL.

I've made an internal bug and brought it up with the right people, I'll follow up after that discussion.

Internal tracking number: 119670123

bkendall avatar Nov 16 '18 17:11 bkendall

Looks like it is hardcoded here: https://github.com/firebase/firebase-tools/blob/40afb70e9626efe526e46697f9847d1a92c47e06/src/hosting/functionsProxy.ts#L56

jhuleatt avatar Apr 09 '19 22:04 jhuleatt

any updates on this?

rendomnet avatar Apr 10 '19 08:04 rendomnet

This is a bug and we are tracking it, but there are no updates yet.

kevinajian avatar Apr 10 '19 21:04 kevinajian

This bug was fixed when we released the new functions emulator backend. When supplying a region, it will now be in the URL like http://localhost:5000/project_id/asia-northeast1/helloWorld

abeisgoat avatar Jun 25 '19 18:06 abeisgoat