firebase / firebase/firebase-tools-ui
Emulator firestore UI Defaults to the literal name `default` Project Even with `.firebaserc` has 'default' parameter set to something else
- Dominant language
- TypeScript
- Stars
- 291
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
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:
```json
{
"projects": {
"default": "my-project-local",
"my-firebase-project": "my-project-cfbe5"
}
}
```
From the root directory (same place as `.firebaserc`), I run:
```zsh
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` (or `firebase-admin`) targeting `my-project-local` **did 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:
```bash
firebase emulators:start --project my-project-local
```
Which 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!
Contributor guide
Assessment
This issue has not been assessed yet.