Firebase cloud functions emulator times out after 30000 ms

Viewed 2711

I'm trying to run firebase emulators:starts on my project that makes use of Cloud Functions.

It starts the local server at port 5001, if I open it in Chrome I get a { "status": "alive" } response, but after 30 seconds it shuts down by itself because of a "timeout".

āœ”  functions: Emulator started at http://localhost:5001
i  Shutting down emulators.
i  Stopping functions emulator

Error: TIMEOUT: Port 5001 was not active within 30000ms

The project works fine when deployed to Google Cloud, so what's the issue?

I tried to run it with sudo but it didn't help.

I'm on Windows 10 with WSL (Ubuntu).

2 Answers

As discussed in this comment, setting "host": "127.0.0.1"in the firebase.json resolved the issue for me.

firebas.json should look sth like this.

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "emulators": {
    "firestore": {
      "port": 5000,
      "host": "127.0.0.1"

    },
    "ui": {
      "enabled": true
    }
  }
}
Related