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

340
Views
How to fetch data from Firebase Database with react native? (Warining: Error: child failed: path argument was an invalid path)

I have a managed workflow expo project (Javascript 9) where I want to read my data from Firebase database. I succesfully managed to implement firestore but the database is giving me rough times.

This is my code to Fecth the data:

export const fetchEmployees = async () => {
  const rootRef = await dbref(db_realtime,"Employees");
  const query = get(query(child(rootRef))).then((result) =>{
    console.log(result)
  })
}

This is the warning I get:

[Unhandled promise rejection: Error: child failed: path argument was an invalid path = "undefined". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"]

And this is how the data looks like in my Firebase Database storage:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hope this example will help you. It will return all employees details -

const getdata = await db.ref('Employees').once('value',function(snapshot){
    console.log(snapshot.val)
}

Here db is your firebase.database().

If it's not working use 'Employees/'.

EDITED -

For 9 -

import { getDatabase, ref, onValue} from "firebase/database";

const db = getDatabase();
const employeeRef = ref(db, 'Employees');
onValue(employeeRef , (snapshot) => {
  console.log(snapshot.val());
});
about 4 years ago · Juan Pablo Isaza Report
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!