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

Using both firebase-remote-config and firebase-analytics on the same project throws Error: Uncaught (in promise): Firebase app already exists #13

Open
mic345 opened this issue Dec 2, 2020 · 0 comments

Comments

@mic345
Copy link

mic345 commented Dec 2, 2020

Describe the bug

Using both firebase-remote-config and firebase-analytics on the same project throws core.js:4197 ERROR Error: Uncaught (in promise): Firebase app already exists.

This happens due to both modules require the call to their initializeFirebase respectively and both functions rejects if window.firebase is already initialized. Note that if you do not call those functions, the services are not operational due to the firebase service member not being set (this.analyticsRef and this.remoteConfigRef).

To Reproduce

  1. Create a vanilla project.
  2. Add both @capacitor-community/firebase-analytics and @capacitor-community/firebase-remote-config.
  3. Add an ionic service for each of the services.
  4. On each of the services call initializeFirebase

Expected behavior

Support using both @capacitor-community/firebase-analytics and @capacitor-community/firebase-remote-config on the same project.

Additional context

Ionic:

Ionic CLI : 6.11.8 (/home/vagrant/.config/yarn/global/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.4.2
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3

Capacitor:

Capacitor CLI : 2.4.2
@capacitor/core : 2.4.2

Utility:

cordova-res : not installed
native-run (update available: 1.2.2) : 1.2.1

System:

NodeJS : v12.18.3 (/home/vagrant/.nvm/versions/node/v12.18.3/bin/node)
npm : 6.14.6
OS : Linux 4.9

mic345 pushed a commit to mic345/firebase-remote-config that referenced this issue Dec 7, 2020
Added initial support for multi Firebase plugins in the same project
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

1 participant