Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

768
Visualizações
auth.signInwithPopup is not a function firebase

I am using firebase google authentication to authenticate user using goole.

But i am facing an error which is given below....

(0, _auth.signInWithPopup) is not a function. (In '(0, _auth.signInWithPopup)(auth, provider)', '(0, _auth.signInWithPopup)' is 
undefined)

and unable to fix it.

here is my code ...

import statements

import {getAuth,GoogleAuthProvider,signInWithPopup} from "firebase/auth"

the function

const googlelogin=async()=>{
        const auth=getAuth()
        const provider=new  GoogleAuthProvider()
        try{
            
            const result=await signInWithPopup(auth,provider)
            // const credentials=GoogleAuthProvider.credentialFromResult(result);
            // const token=credentials.accessToken
            // const user=result.user
        }
        catch(e){
            console.log(e)
        }
        
    }

Please tell me how to solve this error...

Thanks in advance

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

getAuth() function can not be empty. first you should pass the firebase configurations which are can be found on firebase app -> project settings to the initializeApp() function. then pass the results to the getAuth() function.

import {initializeApp} from "firebase/app";
import {getAuth} from 'firebase/auth';

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

const firebaseApp = initializeApp(firebaseConfig);
const auth = getAuth(firebaseApp);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda