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

405
Vistas
firebase.database(app) arg expects a FirebaseApp instance or undefined

I'm trying to set data to my realtime database on firebase. I have used the following code. I am passing my database name as well as the region in my url still getting this error. Is there anyone who know's what is wrong with the code.

Error "firebase.database(app) arg expects a FirebaseApp instance or undefined.Ensure the arg provided is a Firebase app instance; or no args to use the default Firebase app." I have also initialised the firebase config.

Also I am getting the same problem while fetching data. enter image description here

import {EMPLOYEE_UPDATE,EMPLOYEE_CREATE,} from './types';

import database from '@react-native-firebase/database';

import auth from '@react-native-firebase/auth';

import { firebase } from '@react-native-firebase/app';

import { Actions } from 'react-native-router-flux';


export const employeeUpdate = ({prop,value}) => {

    return {

        type: EMPLOYEE_UPDATE,

        payload: {prop,value},

    };

};



export const employeeCreate = ({name,phone,shift}) => {

    const {currentUser} = auth();

    return (dispatch) =>{

        *const ref = database(

          'https://managerproject-8924c-default-rtdb.asia-southeast1.firebasedatabase.app/')

        .ref(`/users/${currentUser.uid}/employees`);

        console.log(ref);

        ref.set({name,phone,shift})

        .then(()=> {*

            console.log('Data set.');

            dispatch({type: EMPLOYEE_CREATE });

            Actions.employeeList({type: 'reset'});

        });

    };

};

this is my code and output

about 4 years ago · Juan Pablo Isaza
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