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

168
Visualizações
Unable to import Firebase JS SDK with React Native Expo

In my React Native app, I am trying to use the Firebase JS SDK with Expo as mentioned in this guide, although after installing the dependencies via expo install firebase, I am unable to import modules from firebase/auth. Calling the respective methods like getAuth() results in the following error:

TypeError: (0, _auth.getAuth) is not a function. (In '(0, _auth.getAuth)()', '(0, _auth.getAuth)' is undefined)

I am also unable to import modules from firebase/database, firebase/firestore etc.

My project is set up using Typescript, but I also experienced this problem with a JS-only project.

I am able to import firebase from firebase/app, but not the respective modules: enter image description here

edit: I am using getAuth() and the other methods in the following context:

React.useEffect(() => {

 if (response?.type === "success") {
  const { id_token } = response.params;

  const auth = getAuth();      
  const provider = new GoogleAuthProvider();
  const credential = provider.credential(id_token);
  signInWithCredential(auth, credential);
 }
}, [response]);

I am using Firebase 8.2.3.

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

0

The import syntax you're using is for Firebase SDK version 9 and later. For version 8 and below, use:

import firebase from 'firebase/app';
import 'firebase/auth';
...

And then use the v8 syntax as shown here.

about 4 years ago · Juan Pablo Isaza Relatório

0

unfortunatly latest expo sdk is not compatible with firebase9 and if you use this version of firebase you see tones of odd error use firebase version 8

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