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:
- Configure Supabase environment variables in dashboard
- Set STRIPE_SECRET_KEY (sk_test_... for testing)
- Set SUPABASE_SERVICE_ROLE_KEY
- Deploy Edge Functions
- Test with authenticated user