Supabase Update call || Media Types?

On sign up, I’m trying to call the supabase UPDATE function to update the user_type column inside of public.users

After the signup function fires successfully, I call the UPDATE function and get this error:

name: “Error”

stack: “Error: None of these media types are available: application/vnd.pgrst.plan+text; for=“application/json”; options=analyze|verbose|settings|buffers|wal at Object.update (https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/cbf0fa51-0d70-4b1a-9cbe-faaac964c494/dist/manager.js:1:223715) at async S (https://editor-cdn.weweb.io/public/js/index.a50a95e3.js:1:426259)”

message: “None of these media types are available: application/vnd.pgrst.plan+text; for=“application/json”; options=analyze|verbose|settings|buffers|wal”

cause

code: “PGRST107”

details: null

hint: null

message: “None of these media types are available: application/vnd.pgrst.plan+text; for=“application/json”; options=analyze|verbose|settings|buffers|wal”

Any suggestions on what I’m doing wrong?



Do you by any chance have the “explain” option turned on in your Update query? If this is the case, that’s most probably what is causing the issue.

No sir. I turned it on to get information back to try and trouble shoot. Without out it, it just returns succeeded and null.

Well, it causes your error, so you either need to set it up properly, or disable it…

There’s a misunderstanding.

I turned it on ‘after’ realizing the UPDATE fired but didn’t update public.users.user_type from ‘guest’ to ‘host’.

I figure that would provide some logs to assist me in problem-solving.

As you can see, the table is correct, id is bound properly to identify the appropriate row, and “host” is bound properly to be the string to replace guest.

Am I missing something?

Check your RLS policy on the users table, that it allows update

This error is caused by explain, the not updating issue is most probably caused by an incorrect RLS setup as @thomlov already said.