-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ANONYMOUS USER PROVIDER IS NOT WORKING IN FIREBASE UI #1065
Comments
Hi @GarvGupta20, this library expects the compat versions of the JS SDK and won't work with the newer modular API. Are you passing in the modular SDK instead? If not, could you please share how you're initializing Auth so we can help find the cause of the problem? |
@jhuleatt I have exactly the same error and basically the same code. I import everything with |
I'm seeing the same problem using firebase 10.7.1 and firebaseui 6.1.0. All other providers work fine, but AnonymousAuthProvider does not. This is how I'm initialising: import {
getAuth,
GoogleAuthProvider,
GithubAuthProvider,
EmailAuthProvider,
AnonymousAuthProvider,
} from 'firebase/auth'
import * as firebaseui from 'firebaseui'
import 'firebaseui/dist/firebaseui.css'
const auth = getAuth()
const ui = new firebaseui.auth.AuthUI(auth) Configuration is (ignoring front-end display stuff): const allSignInOptions = [
{
provider: GoogleAuthProvider.PROVIDER_ID,
buttonColor: styleColours.primary,
},
{
provider: GithubAuthProvider.PROVIDER_ID,
buttonColor: styleColours.primary,
},
{
provider: 'microsoft.com',
buttonColor: styleColours.primary,
},
{
provider: 'apple.com',
buttonColor: styleColours.primary,
},
{
provider: EmailAuthProvider.PROVIDER_ID,
signInMethod: EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD,
fullLabel: 'Sign in with Email',
buttonColor: 'white',
},
{
provider: firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID,
buttonColor: styleColours.primary,
},
]
ui.start('#firebaseui-auth-container', {
signInOptions: allSignInOptions,
signInSuccessUrl: this.redirect,
}) Clicking the 'Continue as guest' button produces the following error in the console:
The guides on using the compat versions of the various functions are quite difficult to follow; I've also tried using this initialisation: import { getApp } from 'firebase/app'
import firebase from 'firebase/compat/app'
const app = getApp()
const auth = firebase.auth(app)
const ui = new firebaseui.auth.AuthUI(auth) But that results in |
[REQUIRED] Describe your environment
Operating System version: all
Browser version: all
Firebase UI version: 6.1.0
Firebase SDK version: 10.7.1_
[REQUIRED] Describe the problem
When i add firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID in the the firebaseui config then it doesn't work and shows fn anonymouslySignInUser() is not a function
Steps to reproduce:
Relevant Code:
Kindly tell a simple fix for this problem or does it not work with modern firebase sdk
The text was updated successfully, but these errors were encountered: