firebase / firebase/firebase-tools

Hide the implied firebase admin-app created by Web Frameworks or allow this feature to be disabled

Open
#5,874 5 comments 1 reaction 0 assignees View on GitHub
integration: web frameworks type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

Hey all, I appreciate that this isnt the most useful of repros, or context, I'll try add something later. But I wanted to post as this caused be a days worth of head scratching (partially due to some misleading firebase-admin reporting of token sources, but also due to accidentally updating a -g install of firebase-tools.

I believe the root cause to be some pseudo or automatic firebase-adming app being initialized which threw out my firebase admin `initializeApp` logic. But I'm still investigating. Reverting back to firebase-tools@11.28.0 seems to have helped.

### [REQUIRED] Environment info

**firebase-tools:** firebase-tools@12.1.0 (Last known working version firebase-tools@11.28.0)

**Platform:** Windows

### [REQUIRED] Test case

Any basic nextjs project with firebase and webFrameworks on.

### [REQUIRED] Steps to reproduce

Basic firebase nextjs13 project with firebase auth and firebase-admin.

```
if (!firebaseAdmin.apps.length) {
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.cert({
privateKey: process.env.NEXT_PUBLIC_PRIVATE_KEY,
clientEmail: process.env.NEXT_PUBLIC_CLIENT_EMAIL,
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
}),
databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,
});
}
```

### [REQUIRED] Expected behavior

Initialize the default firebase app on the firebase function.

### [REQUIRED] Actual behavior

Some pseudo firebase project named "firebase-frameworks" is already initialized, breaking the above. This initialized project also doesnt seem to work with firebase auth, and produced red-herring messages about token source.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.