The other posts regarding this error are extremely scattered, and most are not for my use case of Firebase Storage.
This current handleSubmit function for a multi field form with an image uploader:
- Stores (put) the photo into Storage successfully and creates a link
However the 2nd storage function: storage().ref("prodimages").child(productThumbnail.name).getDownloadURL() .then((url) => {
is unable to go through with its process of getting the downloadURL so that it can be assigned to another React Hook to then be processed by a redux function.
We'd appreciate any thoughts.
const handleSubmit = (e) => {
e.preventDefault();
storage()
.ref(`prodimages/${preproductThumbnail.name}`)
.put(preproductThumbnail)
.then(
() => {
storage().ref("prodimages").child(productThumbnail.name).getDownloadURL()
.then((url) => {
setProductThumbnail(url);
dispatch(
addProductStart({
productCategory,
productName,
productThumbnail,
productPrice,
productDesc,
})
)
});
},
resetForm()
)}