ERROR [_FirebaseError: initializeFirestore() Updating to 19.0.0-rc.0
mvergarair opened this issue · 4 comments
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,
]
};
This issue does not seem to follow the issue template. Make sure you provide all the required information.
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)]
}
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.