Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

404
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!