question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firestore data not shown in emulator UI

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 8.4.3

Platform: macOS

[REQUIRED] Test case

I am running the emulator UI locally and connecting my android device to the local emulator UI. I am using following code to connect my firestorm DB from the android device.

val settings = FirebaseFirestoreSettings.Builder()
                .setHost("10.0.2.2:8080")
                .setSslEnabled(false)
                .setPersistenceEnabled(false)
                .build()

firestoreInstance = FirebaseFirestore.getInstance()
firestoreInstance.firestoreSettings = settings

I wanted to test firestore database in my local.

[REQUIRED] Steps to reproduce

  1. Start emulator UI
  2. Setup firestore setting in android.
  3. Add some data to firestore.

[REQUIRED] Expected behavior

The data which is added from device should be visible on firestore emulator UI. http://localhost:4000/firestore

[REQUIRED] Actual behavior

The data is successfully pushed to the local emulator and got an update on the android device. But the data is not visible firestore emulator UI. http://localhost:4000/firestore

Workaround: If we paste firestore URL manually on the browser then we are able to see the data. Screenshot 2020-07-13 at 8 20 17 AM

As we can see that the document PRWJQ4Sp... is visible now. But it is not shown under users collection.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brandonhubcommented, Mar 21, 2021

@heyalexchoi @burhanrashid52 if you’re reading and writing data to the emulator but can’t see it in the UI check your project IDs. The Emulator UI only shows data for one project ID, the one you used to start the emulators with emulators:start. It’s likely that your tests or your code are writing to a different project, which would be invisible in the UI.

Can’t stress this enough. I was moving my dev environment from another remote firebase project to a local one powered by a firebase emulator. My emulator was emulating my production project but I was calling firebase.initializeApp with my dev project API keys/projectIDs/appIDs. That caused some wonky behavior where some reads would work, but writes wouldn’t go through (they would return 200 but not update the UI). So anybody having trouble with wonky emulator UI stuff or just emulator behavior in general…double check your project ids!!!

0reactions
yuchenshicommented, Mar 28, 2022

There are two problems here. The original one is a bug that we’ve fixed. There’s the additional one when project IDs don’t match, which has the same symptom but can be solved by double checking the Project ID in the App code where Firebase options are specified. And for @loolooii, I think you’ve run into a completely different issue. As shown in your code, you’ve called useFirestoreEmulator twice with different ports – please remove the last line and make sure your ports match the ones printed by emulators:start.

We’re going to lock this issue here because the original issue was fixed. For anyone reading this, we’d appreciate it if you can open a new issue if you’re still having troubles. (And please do check your initialization code to make sure Project IDs do match.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firestore data in emulator not showing up in emulator UI #2365
The local emulator was working, just not showing any data. Once I switched my config settings to the correct environment, all was well...
Read more >
Why don't I see data in the Firebase Cloud Firestore Emulator ...
The emulator UI only shows the active project, i.e. the one used in firebase use . If tests use this project ID, their...
Read more >
Connect your app to the Cloud Firestore Emulator - Firebase
The Cloud Firestore emulator lets you visualize client requests in the Emulator Suite UI, including evaluation tracing for Firebase Security Rules. Open the ......
Read more >
Firebase Emulator UI
The web UI for Firebase Emulator Suite. Features include: Overview of Emulators running; Firebase Realtime Database Data Viewer/Editor; Cloud Firestore Data ...
Read more >
The Local Firebase Emulator UI in 15 minutes - YouTube
In this video, you will learn how to set up these emulators so you can develop without network latency, create better unit and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found