Backlink

Edge Function Diagnostics

Debug Supabase Edge Function issues and subscription creation errors.

Edge Function Diagnostics

Test Supabase Edge Functions and identify subscription creation issues

Common Edge Function Issues & Solutions

🚨 Critical Issues:

  • Missing Environment Variables: Check Supabase dashboard for STRIPE_SECRET_KEY
  • Authentication Errors: Ensure user is signed in before creating subscriptions
  • Edge Function Not Deployed: Deploy functions using Supabase CLI
  • Invalid Price ID: Verify Stripe price IDs are correct

🔧 Quick Fixes:

  • Redeploy Functions: Run `supabase functions deploy create-subscription`
  • Check Logs: Use `supabase functions logs` to see detailed errors
  • Test Mode: Use Stripe test price IDs (price_test_...)
  • CORS Issues: Ensure CORS headers are properly set

✅ Environment Setup:

  1. Configure Supabase environment variables in dashboard
  2. Set STRIPE_SECRET_KEY (sk_test_... for testing)
  3. Set SUPABASE_SERVICE_ROLE_KEY
  4. Deploy Edge Functions
  5. Test with authenticated user