Closed KazTheCreator closed 1 week ago
Are you sure your @nuxt/ui
version is 2.13
, because since 2.15
your uploadAvatar
function would receive the files directly, no need to do evt.target.files
.
You are right I had ^2.13.0 in package.json and it seems the latest npm i did used 2.15. Thank you very much & sorry for the inconvenience.
I did it like this and it works now: files.value = evt const file = files.value[0]
Might be interesting though for the UInput Docs Page?
Since the guide of supabase and the rest that I found researching was using the evt.target.files
approach.
Environment
Version
v.2.13.0
Reproduction
https://stackblitz.com/edit/nuxt-ui-g7snqc?file=app.vue
Description
Hey! Im running into a new issue with UInput and Supabase Storage Upload.
Ive created a component to upload/update an avatar image from the app to supabase storage. Im following this docs: https://supabase.com/docs/guides/getting-started/tutorials/with-nuxt-3#create-an-upload-widget
When im using a native input html tag and follow the guide/doc it works and the file will be uploaded correctly to storage bucket in supabase.
In case im using a UInput type file it will fail.
It seems to me the issue is the following: Native Input Change Event is a valid Object of evt.target.files UInput Change Event is a String of the computed Path. (It computes to the C:..FakePath/generic-avatar-a.jpg)
Is there a way to "not" get the FakePath? Am I missing something? Ive tried a v-model on UInput too, which resulted in supabase recieving the string of fakepath url.
Ive provided a reproduction in a minimalistic way. Thank you in advance for looking at the issue! :)
Additional context
This works:
This fails:
Function:
Logs