-
Notifications
You must be signed in to change notification settings - Fork 1.1k
"TypeError: app.auth is not a function" when using PhoneAuthProvider #961
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
Comments
Hi, I wanted to help you but I'm not a react developer. But I'm using firebaseui just by using CDN. As far as I know, firebase compat does not work in modular. That's why you couldn't import it. Based on firebase documentation,
Thus, it only works if you use the v8 code style. I tried modified the code from the issue.
Now it works as expected. I have also tried using React with the version of he was using including the instruction the devs asked to try but also to no avail. I think the devs might have mistaken on how to import the library. Firebase v9 Compat is there to help developers move to v9 with the old code style. I hope I might have helped you in this situation. Note : You can't use both v9 Compat and v9 Modular at the same time as both cannot be firebase cannot be initialized twice. What I mean is that when you are using the old compat with firebaseui, the login state only remain in the compat library, not the modular one. When you enter other pages, you'll face problems as you can't prove the user is already authenticated. |
After deeper analysis, I think this a bug due to the recaptcha is still using the compat library, making it throwing error when we are using the modular ones. This could be solved once firebaseui is fully utilising modular ones |
Getting same error here... I'm trying to use with next-firebase-auth |
same issue here .... cannot really fallback to compat mode |
I also have this issue. I use next-firebase-auth and firebaseui-react
|
I fixed problem by importing PhoneAuthProvider from 'firebase/auth' . ps: I have fixing this for two weeks . I am ok with firebase v8 but firebase v9 error happened . Now everything is fine. |
Same issue for me. The error on the console gets thrown by the compat library:
This issue makes mobile signin impossible. |
I found the fix here and it worked for me: firebase/firebaseui-web-react#166 (comment) |
FirebaseUI still requires the |
Copied from #901
My project is React and when I run this code, I get this error
TypeError: app.auth is not a function.
This only happens when I use PhoneAuthProvider.PROVIDER_ID, when I insert GoogleAuthProvider.PROVIDER_ID everything works fine.
firebase no longer exposes
compat
functions. This becomes a major blocker to usefirebaseui-web.
The text was updated successfully, but these errors were encountered: