{"record":{"id":"97b6973efaab8840","repo":"Stirling-Tools/Stirling-PDF","slug":"unknown-error-occurred-during-signup","errorCode":null,"errorMessage":"Unknown error occurred during signup","messagePattern":"Unknown error occurred during signup","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/editor/src/saas/routes/signup/AuthService.ts","lineNumber":31,"sourceCode":"        data: { full_name: name },\n      },\n    });\n\n    if (error) {\n      console.error(\"[Signup] Sign up error:\", error);\n      throw new Error(error.message);\n    }\n\n    if (data.user) {\n      console.log(\"[Signup] Sign up successful:\", data.user);\n      return {\n        user: data.user,\n        session: data.session,\n        requiresEmailConfirmation: data.user && !data.session,\n      };\n    }\n\n    throw new Error(\"Unknown error occurred during signup\");\n  };\n\n  const signInWithProvider = async (\n    provider: \"github\" | \"google\" | \"apple\" | \"azure\",\n  ) => {\n    const { error } = await supabase.auth.signInWithOAuth({\n      provider,\n      options: { redirectTo: absoluteWithBasePath(\"/auth/callback\") },\n    });\n\n    if (error) {\n      throw new Error(error.message);\n    }\n  };\n\n  return {\n    signUp,\n    signInWithProvider,","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/frontend/editor/src/saas/routes/signup/AuthService.ts#L13-L49","documentation":"Thrown by AuthService.signUp() in the edge case where supabase.auth.signUp() returns no error AND no user object. This means data.user is falsy despite no error — an unusual Supabase response indicating the call neither succeeded nor failed in a recognized way. This is a defensive catch-all for an unrecognizable auth response.","triggerScenarios":"Supabase returns { data: { user: null, session: null }, error: null }. This can happen during Supabase service degradation, when email auth is misconfigured (e.g. email confirmations required but SMTP not set up, causing the user object to not be returned), or when the network response is truncated/corrupted.","commonSituations":"Supabase project has email confirmation enabled but no SMTP configured, leading to an inconsistent auth response; Supabase service is temporarily degraded; auth provider misconfiguration.","solutions":["Check Supabase Dashboard > Authentication > Settings — verify email auth is enabled and SMTP is configured if email confirmation is on","Check the Supabase status page for service degradation","Log the full supabase.auth.signUp() response (data and error) to diagnose the missing user","Retry after confirming the Supabase project configuration is correct"],"exampleFix":"// before\nif (data.user) { return { ... }; }\nthrow new Error(\"Unknown error occurred during signup\");\n\n// after\nif (data.user) { return { ... }; }\nconsole.error(\"[Signup] No user and no error:\", { data, error });\nthrow new Error(\n  \"Signup did not return a user. Check Supabase auth configuration.\",\n);","handlingStrategy":"try-catch","validationCode":"// Check Supabase auth configuration is healthy\nconst { data, error } = await supabase.auth.getSession();\nif (error && error.message.includes('not enabled')) {\n  showConfigError('Email auth is not enabled in this Supabase project');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const result = await signUp(email, password, name);\n} catch (e) {\n  const msg = e instanceof Error ? e.message : '';\n  if (msg.includes('Unknown error')) {\n    // Log full response and suggest checking Supabase config\n    console.error('[Signup] Unrecognized response — check Supabase auth settings');\n    setFormError('Sign up is temporarily unavailable. Please try again later.');\n  } else {\n    setFormError(msg);\n  }\n}","preventionTips":["Verify email auth is enabled and SMTP is configured if email confirmation is required in Supabase Dashboard","Log the full signUp response (data + error) to catch this edge case during debugging","Monitor Supabase service status for degradation that could cause incomplete auth responses"],"tags":["auth","signup","supabase","edge-case","saas"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}