SupabaseS
Supabase11mo ago
Ben

Unknown DB Error when creating a new user

Hello helpful people! Running into an "unknown db error" when trying to sign up a user in our project. This feature was working previously I'm guessing it's something to do with our config that's changed in the last week. The error:

signUpError 1 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAuthWeakPasswordError = exports.AuthWeakPasswordError = exports.isAuthRetryableFetchError = exports.AuthRetryableFetchError = exports.AuthPKCEGrantCodeExchangeError = exports.AuthImplicitGrantRedirectError = exports.AuthInvalidCredentialsError = exports.AuthInvalidTokenResponseError = exports.isAuthSessionMissingError = exports.AuthSessionMissingError = exports.CustomAuthError = exports.AuthUnknownError = exports.isAuthApiError = exports.AuthApiError = exports.isAuthError = exports.AuthError = void 0;
class AuthError extends Error {
constructor(message, status, code) {
super(message)
AuthApiError: Database error saving new user
code: "unexpected_failure"


The code:

 const supabase = createClient(
    process.env.SUPABASE_URL!,
    process.env.SUPABASE_KEY!,
    {
      auth: {
        autoRefreshToken: false,
        persistSession: false,
      },
    }
  );

// Some checks to make sure that an exisiting user doesn't exist

  // Create user in Supabase
  const { data: signUpData, error: signUpError } = await supabase.auth.signUp({
    email,
    password,
    options: {
      data: {
        full_name: fullName,
        email,
        phone,
        // Some required fields included here
      },
    },
  });
Was this page helpful?