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
I get a type error after uploading a file, as "id" is not defined in current version 2.5.5 return data type for the upload function.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
use current supabase/storage-js version 2.5.5 and TypeScript.
use this code
const{ data }=awaitsupabase.storage.from("bucket_name").upload(`filename`,fileData);if(data){constfileId=data.id;// <<< Property 'id' does not exist on type '{ path: string; }'.ts(2339)}
Result: Property 'id' does not exist on type '{ path: string; }'.ts(2339)
Expected behavior
no type error while accessing .id as the type is correctly defined.
Bug report
Describe the bug
I get a type error after uploading a file, as "id" is not defined in current version 2.5.5 return data type for the upload function.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Result:
Property 'id' does not exist on type '{ path: string; }'.ts(2339)
Expected behavior
.id
as the type is correctly defined.Screenshots
version 2.5.5 type definition
v2.5.5 code (latest version)
https://github.com/supabase/storage-js/blob/v2.5.5/src/packages/StorageFileApi.ts#L141
main code:
https://github.com/supabase/storage-js/blob/main/src/packages/StorageFileApi.ts#L142
It looks like something did not work as planned as there are commits fixing the upload return type:
https://github.com/supabase/storage-js/commits/v2.5.5
in
main
the code is fine since this commit Dec 19 2023:68a6197
So I guess you just need to release v2.5.6 to fix it again 😄 Thanks.
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: