Firebase: Troubleshooting “The default Firebase app does not exist…”

zhifei
Dec 17, 2021

If like me, you’ve came across one of the following error while trying access FirebaseAdmin’s services, i.e.:

  1. “The default Firebase app does not exist…”
  2. “_this.ensureApp(…).firestore is not a function”
  3. “TypeError: firebaseApp.getOrInitService is not a function”

The solution is simply doing the following:

Explanation: Using the first element in admin.apps (App[]), instead of the default app (admin.app).

--

--

zhifei

Software engineer. Jack of all stacks, master of none.