Firestore Emulator slow on M1?

965 views
Skip to first unread message

will

unread,
Feb 1, 2021, 3:07:23 PM2/1/21
to Firebase Google Group
Hey everyone!

Is anyone experiencing slow connections when using the Firestore Emulator with Apple's M1 processor?

I just got a new MacMini M1 and requests sent to the emulator (running on a terminal with Rosetta 2) take a long time to complete. I always get the following error: "@firebase/firestore: Firestore (8.2.2): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend."

I wonder if other people are also having related issues or if it's just me (maybe something I'm doing wrong). I have the same setup in another machine and it's working fine. This slowness seems to happen only with the M1 processor. 

will

unread,
Feb 2, 2021, 9:05:19 PM2/2/21
to Firebase Google Group
Update: It looks like this issue is happening because I set "host" to "0.0.0.0" in the "firebase.json" file. This works fine on my older machine but it's slow on Apple Silicon (M1). If I remove the host value, then it works fine but I lose the ability to use the emulator on another machine in my network (i.e. on a tablet using my IP address).

Sam Stern

unread,
Feb 3, 2021, 6:16:13 AM2/3/21
to Firebase Google Group
Hey Will,

Thanks for sharing your issue and also following up with your partial solution. Nobody who works on the CLI has an M1 Mac yet so we're pretty much stuck when it comes ot M1-specific issues.  I wonder if this is actually to do with the M1 processor or whether a recent macOS update changed how 0.0.0.0 works ... our emulators are just simple JAR binaries so there's not much we can do to speed up their local network calls.

If you discover anything else here please let us know!

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/5a9ba4e0-e85b-4024-a9e2-7851f21085a0n%40googlegroups.com.

will

unread,
Feb 3, 2021, 7:23:41 AM2/3/21
to Firebase Google Group
Hey Sam! Not sure yet if this is M1-specific since I didn't manage to test it on another M1 machine but editing the hosts file fixed this issue for me. After I added my computer's name (Will.local) next to localhost, it started working again:

127.0.0.1     localhost Will.local
::1                  localhost Will.local

Reply all
Reply to author
Forward
0 new messages