Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

258
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda