4

I installed the Firebase Functions and Firestore emulators in my project with firebase init > emulators but now realize I don't need the Functions emulator any more so I'm trying to delete it.

How can I uninstall an emulator so that the firebase emulators:start command doesn't try to start it by default?

I tried the following but firebase init > emulators continues to show that the functions emulator is still enabled (green dot) and firebase emulators:start continues to start the functions emulator by default if I don't include the --only firestore flag.

  • I reran firebase init > emulators and deselected functions
    • This didn't do anything
  • I manually removed the entry from firebase.json
    "emulators": {
      "functions": { // <-- I removed this block
        "port": 5001
      },
      "firestore": {
        "port": 8080
      },
      "ui": {
        "enabled": true
      }
    }
    
  • I cleared the emulator cache from ~/.cache/firebase/emulators
  • I removed the functions block from firebase.json just to see if that was triggering it.
    {
      "functions": { // <-- I removed this block
        "predeploy": [
          "npm --prefix \"$RESOURCE_DIR\" run clean",
          "npm --prefix \"$RESOURCE_DIR\" run lint",
          "npm --prefix \"$RESOURCE_DIR\" run build"
        ],
        "source": "functions"
      },
      "firestore": {
        "rules": "firestore.rules",
        "indexes": "firestore.indexes.json"
      },
      "emulators": {
        "firestore": {
          "port": 8080
        },
        "ui": {
          "enabled": true
        }
      }
    }
    

After doing all of the above, firebase emulators:start still tries to start functions. I wondered if it might be because the firestore emulator depends on the functions emulator but if that were the case I don't know why it would let me run the firestore emulator alone with --only firestore

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
geg
  • 4,399
  • 4
  • 34
  • 35

2 Answers2

2

In my case, I deleted the Function directory from node_modules and I removed the functions block from firebase.json too.

I fixed it just running npm install firebase again.

Kumar Saurabh
  • 2,297
  • 5
  • 29
  • 43
1

If you don't want to use Cloud Functions in your project, you should remove the "functions" folder from your project directory as well.

Also, suggest that you file a bug for this on the firebase-tools GitHub. The fact that the functions emulator runs without configuration in firebase.json feels like a bug, and it didn't used to work that way.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • 1
    Thanks I filed a bug. I do want to use functions, just don't need to run the functions emulator – geg Dec 17 '20 at 23:24