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.

Emulator UI should not connect to 0.0.0.0 for emulators

See original GitHub issue

In firebase.json, it is possible to specify 0.0.0.0 for host for each emulator. This tells an emulator to listen on all IPv4 interfaces (including 127.0.0.1, the device’s public network IP, etc.).

{
  // ...
  "emulators": {
    "firestore": {"host": "0.0.0.0", "port": 8080},
  }
}

However, with this setup, the Emulator UI attempts to send requests http://0.0.0.0:8080 to reach Firestore in the Firestore viewer. This is invalid since 0.0.0.0 is a non-routable address but some browsers / platforms (such as Chrome on Linux) special cases it to mean the same as 127.0.0.1. On other browsers / platforms (such as Chrome on Windows), this fails with errors like net::ERR_ADDRESS_INVALID.

Instead, the Emulator UI should change it to 127.0.0.1 when constructing the URL. Similarly, the Emulator UI should connect to ::1 (IPv6 local) when :: (IPv6 zero) is specified.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
yuchenshicommented, Jun 18, 2020

@moneal @blastdan I think it’s https://github.com/firebase/firebase-tools-ui/issues/210 – a known issue. However, we still haven’t found a great cross-platform solution and would appreciate any help there. Either way, let’s move the discussion there.

1reaction
gautamsingalcommented, Jun 12, 2020

@yuchenshi I would like to pick this up. As per my understanding, I think simply changing host to 127.0.0.1 in emulators would make it work. Please correct me if something else also needs to be done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firestore emulator: can't see documents in UI using host 0.0.0.0
I've populated firestore with data using the emulator UI, and used firebase emulators:export test_data to export some test data. I now use this ......
Read more >
Prototype and test web apps with the Firebase Hosting Emulator
Note: It's generally a good practice to use one project ID for all emulator invocations, so the Emulator Suite UI, different product emulators, ......
Read more >
Port 8080 is not open on localhost, could not start Firestore ...
This error is because of the failed quitting from firebase emulator. You already have the process of previous firebase emulator. This command will...
Read more >
Testing apps locally with the emulator | Cloud Pub/Sub ...
The string does not need to represent a real Google Cloud project because the Pub/Sub emulator runs locally. gcloud beta emulators pubsub start...
Read more >
Use Azurite emulator for local Azure Storage development
Azurite will continue to be updated to support the latest versions of Azure Storage APIs. There are several different ways to install 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