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

ERROR [_FirebaseError: initializeFirestore() Updating to 19.0.0-rc.0 #3580

Closed
mvergarair opened this issue Nov 21, 2024 · 3 comments
Closed

Comments

@mvergarair
Copy link

Updating to 19.0.0-rc.0 produces the following error:

ERROR [_FirebaseError: initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.] {
  code: 'failed-precondition',
  customData: undefined,
  toString: [Function (anonymous)]
}

App config:

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes, withComponentInputBinding()), provideClientHydration(),
    provideFirebaseApp(() => initializeApp(environment.FIREBASE_CONFIG)),
    provideAuth(() => getAuth()),
    provideFirestore(() => initializeFirestore(getApp(), {
      localCache: persistentLocalCache({
        tabManager: persistentMultipleTabManager(),
      }),
    })),
    provideAuth(() => getAuth()),
    provideFunctions(() => getFunctions()),
    provideAnimations(),
    MatDialog,
  ]
};

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@JGSolutions
Copy link

I am getting this error:

ERROR [_FirebaseError: Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?] {
code: 'invalid-argument',
customData: undefined,
toString: [Function (anonymous)]
}
ERROR [_FirebaseError: Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?] {
code: 'invalid-argument',
customData: undefined,
toString: [Function (anonymous)]
}

@jamesdaniels
Copy link
Member

The root cause here is that the old rxfire depended on Firebase v10 where we now use v11, so there were multple competing versions. I've raised the bad error messaging here with the JS SDK team, hopefully we'll at least get sensible error messages here in the future.

In the meantime the rxfire CI/CD pipeline has been unclogged, rc.2 now uses the version that's marked as compatible with Firebase v11—so this issue should be addressed.

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

4 participants