-
Notifications
You must be signed in to change notification settings - Fork 951
Description
[REQUIRED] Describe your environment
- Operating System version: windows@latest
- Browser version: chrome@latest
- Firebase SDK version: firebase@latest (^8.5.0)
- Firebase Product: firestore/auth (auth, database, storage, etc)
[REQUIRED] Describe the problem
{code: "auth/invalid-api-key", message: "Your API key is invalid, please check you have copied it correctly.", a: null}
Steps to reproduce:
Using the documentation at https://firebase.google.com/docs/emulator-suite/connect_and_prototype the code snippett says:
// Firebase previously initialized using firebase.initializeApp().
However, it is unclear how one should call initializeApp()
. Using the example linked in https://www.youtube.com/watch?v=pkgvFNPdiEs&t=314s, the firebaseConfig
:
{
"databaseURL": "http://localhost:9000?ns={my project name here}"
}
produces the following error:
{code: "auth/invalid-api-key", message: "Your API key is invalid, please check you have copied it correctly.", a: null}
However, the firebaseConfig
(project name substituted in):
{
"apiKey": "this-does-not-matter-but-it-crashes-without-it",
"projectId": "mock-firebase-backend",
}
Works just fine with no errors. I have confirmed this by sending reads and writes to the emulator without errors:
Am I missing something, or did the behaviour break between when the video was released and the current package version on npm?
Relevant Code:
Shown above