Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only [DEFAULT] firebase app is recognized #153

Open
rrust opened this issue Jul 24, 2023 · 1 comment
Open

Only [DEFAULT] firebase app is recognized #153

rrust opened this issue Jul 24, 2023 · 1 comment
Assignees

Comments

@rrust
Copy link

rrust commented Jul 24, 2023

When FireBase is initialized with a name for the app like this:

initializeFirebaseApp(serviceAccount, 'foo');

I'm getting: Error: The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.

When using the firebase initializeApp() function like this:

initializeApp({ credential }, 'foo');

restore() for example fails with a "firebase is not initialized" error.

The only way to make it work for now is to call:

initializeApp({ credential }, '[DEFAULT]');

right before using any functions from this package.

The problem might be that throughoput this library everytime when getFirestore() is called it is done so without the name of the initialized app, which should be getFirestore(getApp(''foo")).

@dalenguyen
Copy link
Owner

Hi @rrust, I updated the package.

When initializing the app, it will return a firestore instance. You can use it to pass to the functions.

const firestore = initializeFirebaseApp(serviceAccount, 'foo');

// backup(firestore,....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants