Giter Club home page Giter Club logo

Comments (8)

daltongray avatar daltongray commented on July 17, 2024 8

I just ran into this and was able to get a workaround up - so far it's working for me, if anyone comes across this in the future, maybe it'll help.

It seems this error is caused when firebaseui-web-react is passed a v9/modular firebase auth instance, instead of the v8/v9-compat firebase auth instance. In other words, if you import and initialize your auth instance like below, you'll get this error when you feed it into <StyledFirebaseAuth /> as it's firebaseAuth prop.

import { getAuth } from "firebase/auth";
import { initializeApp } from "firebase/app";
  
const app = initializeApp(firebaseConfig);

export const authThatWillBreakFirebaseUI = getAuth(app)

It will work if you initialize your firebase app, in the compat style and feed that into firebaseui-web-react. Looks like this:

import "firebase/compat/auth";
import compatApp from "firebase/compat/app";
 
compatApp.initializeApp(firebaseConfig);
export const authForFirebaseUI = compatApp.auth()

I don't want my whole application to use the compat app, so what I did was initialize a second firebase app in the compat style. If you do this, you'll have two firebase app instances in your app - so there's a bit of overhead for managing them, but this solved my problem and allowed me to use phone sign in with this UI library.

from firebaseui-web-react.

m-elgamal avatar m-elgamal commented on July 17, 2024 1

Same issue here!!

from firebaseui-web-react.

icopp avatar icopp commented on July 17, 2024

I've run into the same issue. Any idea on what the fix is?

from firebaseui-web-react.

schpaa avatar schpaa commented on July 17, 2024

Same issue here, recapchta does not show and app.auth missing in console

from firebaseui-web-react.

dr-aiuta avatar dr-aiuta commented on July 17, 2024

same issue here. not clear why it was closed

from firebaseui-web-react.

dr-aiuta avatar dr-aiuta commented on July 17, 2024

any updates?

from firebaseui-web-react.

m-elgamal avatar m-elgamal commented on July 17, 2024

for some reason this issue was opened and closed by OP. may be he can help

from firebaseui-web-react.

coolcorexix avatar coolcorexix commented on July 17, 2024

I just ran into this and was able to get a workaround up - so far it's working for me, if anyone comes across this in the future, maybe it'll help.

It seems this error is caused when firebaseui-web-react is passed a v9/modular firebase auth instance, instead of the v8/v9-compat firebase auth instance. In other words, if you import and initialize your auth instance like below, you'll get this error when you feed it into <StyledFirebaseAuth /> as it's firebaseAuth prop.

import { getAuth } from "firebase/auth";
import { initializeApp } from "firebase/app";
  
const app = initializeApp(firebaseConfig);

export const authThatWillBreakFirebaseUI = getAuth(app)

It will work if you initialize your firebase app, in the compat style and feed that into firebaseui-web-react. Looks like this:

import "firebase/compat/auth";
import compatApp from "firebase/compat/app";
 
compatApp.initializeApp(firebaseConfig);
export const authForFirebaseUI = compatApp.auth()

I don't want my whole application to use the compat app, so what I did was initialize a second firebase app in the compat style. If you do this, you'll have two firebase app instances in your app - so there's a bit of overhead for managing them, but this solved my problem and allowed me to use phone sign in with this UI library.

thank you so much for leave this back, many people are scratching their heads for this problem

from firebaseui-web-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.