postgrest-js icon indicating copy to clipboard operation
postgrest-js copied to clipboard

Supabase JS library delete does not give any response

Open netcamo opened this issue 9 months ago • 0 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Hi! I am using supabase js library. I was using delete function but it doesn't return any response while docs shows there should be a response (successful/unsuccessful). The delete itself works but the problem is I have no way of knowing if any errors happened or it has proceeded successfully.

Reference: https://supabase.com/docs/reference/javascript/delete

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

 try {
    const supabase = createClient();

    const { data,error } = await supabase // At the Moment Supabase does not send error related to RLS  https://github.com/supabase/supabase-js/issues/902
      .from("<tableName>")
      .delete()
      .eq("id", id);
    console.log("data", data);
    console.log(error);
    if (error) {
      console.error("Error deleting :", error.message);
      throw error;
    } else {
      return;
    }
  } catch (error) {
    console.log("Error:", error);
    throw error;
  }

Both error and data are null in all cases (successful/unsuccessfull)

Expected behavior

I would expect it to give a proper response, at least same as the example in docs: image

System information

  • OS: macOS
  • Version of supabase-js:
    "@supabase/ssr": "^0.3.0", "@supabase/supabase-js": "^2.43.1",
  • Version of Node.js: v21.7.1

netcamo avatar May 07 '24 11:05 netcamo