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

Firebase start local emulators for specified codebase only

Open RazaShehryar opened this issue 3 years ago • 8 comments

While having two separate codebases (one for v1 and the other one for v2 functions), it is very frustrating that whenever I run firebase emulators:start --only functions:${codebase-name}, it initializes all the codebase functions.

I would like to start only those functions which falls under the specified codebase name.

RazaShehryar avatar Aug 12 '22 04:08 RazaShehryar

A temporary workaround for this issue is by using the following approach. However, it does not deploy the functions properly.

RazaShehryar avatar Aug 12 '22 05:08 RazaShehryar

This is a great feature request! I'm going to add that label here and if anyone in the community wants to open a pull request, that would be awesome!

colerogers avatar Nov 21 '22 18:11 colerogers

I've successfully managed to start v1 and v2 functions separately using local emulators. I had to define two firebase.json files, one for v1 and the other for v2 (firebase.json and firebase-v2.json. The content of firebase-v2.json is very similar to firebase.json except for the names of source and codebase. In my case, it's functions-v2 and v2, respectively. Now in order to run the v2 functions only, I run this command firebase --config=../firebase-v2.json emulators:start --only functions while for v1 functions, I simply run firebase emulators:start --only functions

RazaShehryar avatar Nov 26 '22 04:11 RazaShehryar

I have expected it to work similar to hosting

 firebase emulators:start --only=functions:[codebase-name],

But seems like it loads all the function anyway.

Is this feature still in development? A year has passed.

2meters-app avatar Aug 25 '23 13:08 2meters-app

Any updates on this?

henkaumio avatar Oct 24 '23 13:10 henkaumio

@colerogers Do you know if anyone has prioritized working on this? I've just begun setting up Firebase in a monorepo with multiple "codebases", and while this bug doesn't technically block local dev, it does force us to run our entire monorepo whenever we're really only working on one codebase.

(IMHO this should be classified as a bug, not a feature request, given the emulators:start command is not properly interpreting the --only option.)

dabrady avatar Dec 14 '23 11:12 dabrady

This is becoming even more of a problem with the experimental webframeworks. firebase emulators:start --only functions:codebase,hosting:site should be congruent with the same capability of firebase deploy --only functions:codebase,hosting:site.

Now nextjs ssr function is also getting found and hosted in parallel to the local start dev. No way to cleanly opt out.

kevpie avatar May 07 '24 18:05 kevpie