Open ishowta opened 1 year ago
Hi @ishowta, thanks for bringing this to our attention. I was able to reproduce the behavior. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share.
This is still a problem; it means that the firebase emulators cannot work without a real existing firebase GCP project - ie they cannot work standalone.
I presume this also means no offline development, no sandbox testing etc... Which is a bit of a shame - I would have preferred the test environment to be completely isolated from Google Cloud (perhaps on a switch if both behaviours are require)
for some reason this has been an issue for me as well... until now
the way around this is to
apiKey: process.env.FIREBASE_API_KEY || "PUT_IN_A_DUMMY_API_KIEY"
put in a dummy api key like this and it worked for me
Would really like to see Firebase's documentation improved for the demo option. Would be ideal to show users how to get setup with a demo project without a pre-existing project.
Hi Ben,
Actually - now its working ok...
Versions;
When I run the emulators I specify the demo project:
"npm run build && firebase emulators:start --project demo-xxx --only=auth,functions,firestore,storage
And I don't provide any more config - in the functions startup its just:
const app = admin.initializeApp();
Personally, I solved my case with template string in the key. I don't know why, but the env value was not working when passed to the object.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
same as #4882 related to 5218
When using the auth emulator, apikey probably should not be necessary, but an
auth/invalid-api-key
error will occur if it is not set.When I put a random value in
apiKey
it seems to work fine.The check for
apiKey
is done on the client side, which was appended before the auth emulator was created, so it is probably not needed. https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/core/auth/register.ts#L68-L71Steps to reproduce:
Initialize auth without specifying apiKey in initializeApp
Relevant Code: