Skip to content

Error: Component auth has not been registered yet #7

@m43nu

Description

@m43nu

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:

  • initializing without configs
  • initializing with initializeApp directly from firebase
  • removed and re-installed node_modules (as proposed here)

but nothing worked. Any advice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions