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

171
Visualizações
Can't resolve firebase

Hi, I'm trying to do a react clone with firebase backend, but for some reason it can't compile.I get a 'can't resolve firebase' message instead. None of the solutions I've found and employed have worked thus far.

Hi, I'm trying to do a react clone with firebase backend, but for some reason it can't compile.I get a 'can't resolve firebase' message instead. None of the solutions I've found and employed have worked thus far.

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

0

It looks like you are using the Firebase SDK 8 code but probably has installed the Firebase SDK 9 version. Your code should look like this with the new SDK:

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

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


const app = initializeApp(firebaseConfig);
const db = getFirestore();
const auth = getAuth();
export { db, auth };

Here you can find more about the migration to the SDK 9 version.

Here is an example how to use the new SDK 9 with collections:

import { collection, onSnapshot } from "firebase/firestore";

const unsubscribe = onSnapshot(collection(db, "cities"), () => {
  // Respond to data
  // ...
});

// Later ...

// Stop listening to changes
unsubscribe();
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