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

256
Views
¿Cómo detectar un error de Firebase Storage cuando el archivo no existe?

Mi aplicación de reacción muestra una imagen si existe en Firebase Storage:

 import firebase from 'firebase/app'; import 'firebase/storage'; //...// const [imageUrl, setImageUrl] = useState(null) //..// firebase .storage() .ref('path_to_image') .getDownloadUrl() .then((v)=>{setImageUrl(v)}) //This sets the imageUrl state. I still get the error even if I remove this line .catch(()=>{setImageUrl(null)}

Pero sigo recibiendo un error 404 registrado en la consola:

OBTENER http://.../v0/....appspot.com/o/userPhotos%2FJfYvcUGG8LkyNwyu1dKpJr6j4EKmE 404 (no encontrado)

Intenté envolver todo en un intento/captura, pero el error aún se registra.

¿Cómo puedo detectar la excepción o hay alguna manera de verificar que el archivo existe antes de llamar a getDownloadUrl?

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!