resulturan / refine-firebase

MIT License
44 stars 22 forks source link

Error: Component auth has not been registered yet #7

Open m43nu opened 1 year ago

m43nu commented 1 year ago

Hey there 👋🏼 thanks for building this library!

I'm struggling to get everything to work with a brand new refine project. I get the error: Error: Component auth has not been registered yet

This is my firebase.ts file:

import {
    initializeFirebase,
    FirebaseAuth,
    FirebaseDatabase,
    FirestoreDatabase
} from "refine-firebase";

export const firebaseConfig = {
    apiKey: "xxx",
    authDomain: "xxx",
    projectId: "xxx",
    storageBucket: "xxx",
    messagingSenderId: "xxx",
    appId: "xxx",
    measurementId: "xxx"
};

export const firebaseApp = initializeFirebase(firebaseConfig);

export const firebaseAuth = new FirebaseAuth(undefined, firebaseApp);

export const firestoreDatabase = new FirestoreDatabase({firebaseApp});

export const firebaseDatabase = new FirebaseDatabase({firebaseApp});

this is the intialization in _app.tsx:

dataProvider={firestoreDatabase.getDataProvider() as any}
authProvider={firebaseAuth.getAuthProvider()}

I tried a few other scenarios:

but nothing worked. Any advice?

resulturan commented 1 year ago

Hi, your problem is still continue?

leotj commented 1 year ago

Hi @resulturan, this issue still happens to me.

m43nu commented 1 year ago

@resulturan yes this is still happening, but I changed to another setup/library, so it's not urgent for me anymore.