Bug report
Describe the bug
The TypeScript type definition for StorageError is incorrect. The error object returned from storage operations (e.g., upload) contains a statusCode property, but the type definition specifies a status property. This mismatch causes type errors or requires unsafe type assertions when handling errors.
To Reproduce
Steps to reproduce the behavior:
- Use the Supabase JavaScript client (
supabase-js) to perform a storage operation, such as uploading a file:
const { data, error } = await supabase.storage
.from("files")
.upload("path/to/file", file, { contentType: "application/pdf" });
- Make sure it returns an error and print it:
console.log(error)
// {"statusCode":"409","error":"Duplicate","message":"The resource already exists"}
Expected behavior
According to the type definition it should have returned: {"status":409,"error":"Duplicate","message":"The resource already exists"}
System information
- OS: Ubuntu
- Version of supabase-js: 2.49.4
- Version of Node.js: 20.15.1
Bug report
Describe the bug
The TypeScript type definition for
StorageErroris incorrect. The error object returned from storage operations (e.g., upload) contains astatusCodeproperty, but the type definition specifies astatusproperty. This mismatch causes type errors or requires unsafe type assertions when handling errors.To Reproduce
Steps to reproduce the behavior:
supabase-js) to perform a storage operation, such as uploading a file:Expected behavior
According to the type definition it should have returned:
{"status":409,"error":"Duplicate","message":"The resource already exists"}System information