-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
β Emulator UI Defaults to default Project Even with .firebaserc Set
π Context
I'm using the Firebase Local Emulator Suite with a .firebaserc configured like:
{
"projects": {
"default": "my-project-local",
"my-firebase-project": "my-project-cfbe5"
}
}From the root directory (same place as .firebaserc), I run:
firebase emulators:startπ¨ Unexpected Behavior
- The Emulator UI defaults to showing
/firestore/default/data, not/firestore/my-project-local/data. - Data written via scripts using
@google-cloud/firestore(orfirebase-admin) targetingmy-project-localdid not show up, and:- No errors were thrown
- Try/catch blocks did not catch anything
- Emulator logs showed no write activity
- Data was not persisted in any database (live or emulator)
This leads to extremely confusing debugging. The developer assumes the projectId is correct and the emulator is running β but the Emulator UI and underlying Firestore instances are misaligned.
β Workaround
The only way to get the emulator and UI to align correctly is:
firebase emulators:start --project my-project-localWhich causes the UI to properly route to:
/firestore/my-project-local/data
β Request
Please consider:
- Making Emulator UI respect
.firebasercβs"default"project - Adding visible warnings or logs when the emulator receives writes with mismatched project IDs
- Logging when data is silently discarded due to unrecognized
projectId
π Why This Matters
Without visible errors or logs, this creates hours of confusion and the risk of:
- Developers unknowingly thinking data was persisted
- Assuming bugs in their write logic
- Worse: accidentally writing to the live database
Thanks for your incredible work on Firebase β and hope this helps make emulator behavior safer and clearer!
Metadata
Metadata
Assignees
Labels
No labels