supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
3.24k stars 264 forks source link

Error on update() #894

Open ohrrkan opened 1 year ago

ohrrkan commented 1 year ago

Version : "@supabase/supabase-js": "2.38.4",

The error object return by the update function is empty => making error identification difficult.

-To reproduce you can for example try to update an non-existent id, or update a database without having the policy right to do it.

const { error } = await supabase.from('countries').update({ name: 'Australia' }).eq('id', 9999)

jcerjak commented 10 months ago

I have a similar problem with insert() and I don't know what's wrong with my data. This issue combined with a lack of debugger support makes it hard to develop...

jcerjak commented 10 months ago

Possibly related issue in postgrest-js: https://github.com/supabase/postgrest-js/issues/381