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

187
Views
TypeError: indefinido no es un objeto (evaluando 'ref.onSnapshot')

Angular y Firebase Firestore arrojan TypeError: undefined no es un objeto (evaluando 'ref.onSnapshot')

 this.fbstore .collection(`claims`, ref => { let query: | firebase.default.firestore.CollectionReference | firebase.default.firestore.Query = ref; if(someValue === true) { return query.where('field1', '==', 20); } }).valueChanges();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El problema es que si someValue es falso, la consulta no se devuelve, agregar otra declaración resolverá el problema o agregará una return query predeterminada. Estos tipos de errores consumen mucho tiempo si confía demasiado en IDE, TypeScript, es fácil ver el problema en este código de muestra.

 this.fbstore .collection(`claims`, ref => { let query: | firebase.default.firestore.CollectionReference | firebase.default.firestore.Query = ref; if(someValue === true) { return query.where('field1', '==', 20); } return query; // this will not run if someValue is true }).valueChanges();
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!