supabase-js
supabase-js copied to clipboard
v2.0.0 - ThrowOnError is not unwrapping the return type
Bug report
Describe the bug
The errors are not being unwrapped when calling throwOnError
On a simple model definition like this one:
export interface Database {
public: {
Tables: {
profiles: {
Row: {
id: string
username: string | null
email: string | null
}
Insert: {}
Update: {}
}
}
Views: {}
Functions: {}
Enums: {}
}
}
const supabase = createClient<Database>(...)
const { data } = await supabaseAdmin
.from('profiles')
.select(`*`)
.throwOnError()
The return type of data is Profile[] | undefined, as you can see on the picture

Expected behavior
When unwrapping the error, the return type should be Table[].
System information
- Supabase version: V2.0.0 rc@10
Thank you for opening this issue @julianpoma ! I will be closing this issue now, since it's 3 years old, and a lot of things have changed in the library. If you find that the issue persists, please add a comment here with details, and I'll be happy to investigate and reopen! Thank you for understanding!