FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.51k stars 399 forks source link

useStorageDownloadURL crashes when there is no file in firebase storage #535

Open kirilligum opened 2 years ago

kirilligum commented 2 years ago

Version info

React: 17.0.2 Firebase: 9.6.6 ReactFire: 4.2.1 Other (e.g. Node, browser, operating system) (if applicable): nodejs v16.16.0

Test case

Steps to reproduce

in the code

  const storage = useStorage();
  const catRef = ref(storage, 'kyc/upload/wy_id');
  const { status, data: imageURL } = useStorageDownloadURL(catRef);

Expected behavior

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)

steveoh commented 1 year ago

I'm seeing same issue.

adamkubina1 commented 1 year ago

Same issue for me... Has anybody found a working solution for this by any chance?

steveoh commented 1 year ago

I stopped using reactfire for this and used the base firebase constructs and it fixed a few issues in our app.

prixrak commented 1 year ago

the same..