Storage file upload returning undefined object #3374
-
I am trying to upload a file into a storage bucket using React. The file is uploaded perfectly into the bucket but the data returned to the upload function from supabase is undefined. const avatarFile = event.target.files[0] in this case, console.log(data) returns undefined. Any thoughts on why this is happening? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
hey @kaustubhuk8 , which version of it should be returning the path as per https://github.com/supabase/storage-js/blob/f650e1a504bd6137bd94880e37c1675c5eb996b7/src/lib/StorageFileApi.ts#L90 which is actually just https://github.com/supabase/storage-js/blob/f650e1a504bd6137bd94880e37c1675c5eb996b7/src/lib/StorageFileApi.ts#L322 so you could construct it yourself as a work around if needed |
Beta Was this translation helpful? Give feedback.
hey @kaustubhuk8 , which version of
supabase-js
are you using?it should be returning the path as per https://github.com/supabase/storage-js/blob/f650e1a504bd6137bd94880e37c1675c5eb996b7/src/lib/StorageFileApi.ts#L90
which is actually just https://github.com/supabase/storage-js/blob/f650e1a504bd6137bd94880e37c1675c5eb996b7/src/lib/StorageFileApi.ts#L322 so you could construct it yourself as a work around if needed