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

256
Visualizações
react native e-library app error-failed to resolve dependency 'firebase'

I am in the middle of creating a simple library app. Here, I am trying to use firestore database in firebase console. I am coding this on the expo snack editor. It does not work. here is a screenshot of the error in the snack editor: error

These 2 lines are definitely causing the error:

import firebase from "firebase/compat/app";
import "firebase/compat/firestore";

PS this is the firebase version 9 sdk

this is my package.json in snack editor: package.json

EDIT: I forgot to mention that this exact code on snack is working fine in VS Code locally. to get a working example of code locally: go to this link: https://snack.expo.dev/@rpshende/e-library-app

Then,

  1. Extract the folder
  2. cd to the folder in terminal
  3. run command 'npm install'
  4. then run command 'expo start'(make sure expo cli is installed for this to work!)
  5. when the expo developer tools are fired up, press 'W' on the terminal to open project in a web browser

EDIT: i think this is a problem with the snack editor itself.....

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

0

Firebase v9 is Different

try this

import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import { getAuth, GoogleAuthProvider , signInWithPopup, } from 'firebase/auth';

const firebaseConfig = {
  apiKey: "AIzaTyD2Jp9aB7ycUbW1z8QyPLmD111rHezHcOw",
  authDomain: "delete-project-c7021.firebaseapp.com",
  projectId: "delete-project-c7021",
  storageBucket: "delete-project-c7021.appspot.com",
  messagingSenderId: "688102987186",
  appId: "1:688102987186:web:e27537ggg7abc2b86b982b"
};

const app = initializeApp(firebaseConfig);

export const db = getFirestore(app);
export const auth = getAuth();

about 4 years ago · Juan Pablo Isaza Relatório

0

As @whitehatcoder says, in the expo bubble editor there are version differences. Firebase should have been on version 8 instead of 9.

I add that you try this { "dependencies": { "firebase": "8.8.1" } }

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