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

164
Views
Realtime listener in Firestore throws type error

I am trying to attach a realtime listener in Firebase 9 for my Vue project. This is my function:

function updateProfiles() {
      
      const q = query(collection(db, "candidateprofiles"), where("useridprimary", "==", store.state.currentUserId));
      onSnapshot(q, (snapshot) => {
        let profiles = []
        snapshot.docs.forEach((doc) => {
          profiles.push({...doc.data(), id: doc.id })
        })
        console.log('success: ' + profiles)
      })
    }

It doesn't work and I get the following error:

"Uncaught (in promise) FirebaseError: Expected type 'Ac', but it was: a custom cn object"

Thanks for any help!

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

0

I solved it, i had a mix of firestore imports from firebase/firestore and firebase/firestore/lite. The latter does not work with onSnapshot

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!