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?