SupabaseS
Supabase4y ago
jxyz

supabase.auth.api.createUser duplicate key value violates unique constraint users_pkey

I have a server-side code using the service key,

const email = 'alice@gmail.com';
const password = 'test1234';
const create_user_response = await supabase.auth.api.createUser({ email, password, email_confirm: true });


I am getting the following error, I am clueless why this happens. Any ideas?

{
  user: null,
  data: null,
  error: {
    message: 'duplicate key value violates unique constraint "users_pkey"',
    status: 500
  }
}
Was this page helpful?