You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useStorageDownloadURL crashes when there is no file in firebase storage #535
if the file is not there, the status should reflect
Actual behavior
the website is blank and in the browser's console:
Uncaught FirebaseError: Firebase Storage: Object 'kyc/upload/wy_id' does not exist. (storage/object-not-found)
useStorageDownloadURL no longer throws when the object is missing. In non-suspense mode (the default, and what your snippet uses) the hook now returns status: 'error' with the underlying error available as error, so your original expectation that "the status should reflect" it now holds:
There's a regression test asserting exactly storage/object-not-found for a nonexistent file.
In suspense mode (suspense: true) errors are still thrown, so a React Error Boundary can catch them. That is intentional and unchanged.
Please note this ships in 5.0.0, not in any 4.x release, since the change is breaking for anyone currently relying on an Error Boundary in non-suspense mode. See the v4 to v5 upgrade guide for the migration path.
Activity
steveoh commentedon Dec 7, 2022
I'm seeing same issue.
adamkubina1 commentedon Apr 4, 2023
Same issue for me...
Has anybody found a working solution for this by any chance?
steveoh commentedon Apr 4, 2023
I stopped using reactfire for this and used the base firebase constructs and it fixed a few issues in our app.
prixrak commentedon Jun 4, 2023
the same..
fix: surface observable errors via status instead of re-throwing
fix: surface observable errors via status instead of re-throwing (#735)
tyler-reitz commentedon Jul 27, 2026
Fixed by #735, merged into the
v5branch.useStorageDownloadURLno longer throws when the object is missing. In non-suspense mode (the default, and what your snippet uses) the hook now returnsstatus: 'error'with the underlying error available aserror, so your original expectation that "the status should reflect" it now holds:There's a regression test asserting exactly
storage/object-not-foundfor a nonexistent file.In suspense mode (
suspense: true) errors are still thrown, so a React Error Boundary can catch them. That is intentional and unchanged.Please note this ships in 5.0.0, not in any 4.x release, since the change is breaking for anyone currently relying on an Error Boundary in non-suspense mode. See the v4 to v5 upgrade guide for the migration path.