Stirling-Tools/Stirling-PDF · error · Error

Supabase is not configured. Checkout is not available.

Error message

Supabase is not configured. Checkout is not available.

What it means

Thrown by createCheckoutSession when Supabase isn't configured. Stripe checkout sessions are created via the Supabase edge function create-checkout, so without Supabase the operation is fundamentally unavailable. The guard fails fast with a message naming the missing capability so the UI can hide/disable the upgrade flow.

Source

Thrown at frontend/editor/src/proprietary/services/licenseService.ts:339

        yearly: enterpriseYearly || null,
        features: (enterpriseMonthly || enterpriseYearly)!.features,
        highlights: (enterpriseMonthly || enterpriseYearly)!.highlights,
        popular: false,
      });
    }

    return groups;
  },

  /**
   * Create a Stripe checkout session for upgrading
   */
  async createCheckoutSession(
    request: CheckoutSessionRequest,
  ): Promise<CheckoutSessionResponse> {
    // Check if Supabase is configured
    if (!isSupabaseConfigured || !supabase) {
      throw new Error("Supabase is not configured. Checkout is not available.");
    }

    // Detect if HTTPS is available to determine checkout mode
    const checkoutMode = getCheckoutMode();
    const baseUrl = window.location.origin;
    const settingsUrl = `${baseUrl}/settings/adminPlan`;

    const { data, error } = await supabase.functions.invoke("create-checkout", {
      body: {
        self_hosted: true,
        lookup_key: request.lookup_key,
        installation_id: request.installation_id,
        current_license_key: request.current_license_key,
        requires_seats: request.requires_seats,
        seat_count: request.seat_count || 1,
        email: request.email,
        callback_base_url: baseUrl,
        ui_mode: checkoutMode,

View on GitHub (pinned to 9ef20dcab8)

Solutions

  1. Gate the upgrade/checkout UI on isSupabaseConfigured so the action can't be attempted.
  2. Set the Supabase env vars in the active .env layer to enable checkout.
  3. Catch the error and show a 'checkout unavailable in this mode' message instead of crashing.

Example fix

// before
const { url } = await licenseService.createCheckoutSession(req);

// after
if (!isSupabaseConfigured) {
  showToast(t('license.checkoutUnavailable'));
  return;
}
const { url } = await licenseService.createCheckoutSession(req);
Defensive patterns

Strategy: validation

Validate before calling

if (!isSupabaseConfigured) {
  showToast(t('license.checkoutUnavailable'));
  return;
}

Type guard

export function canCreateCheckout(): boolean {
  return isSupabaseConfigured;
}

Try / catch

try {
  await licenseService.createCheckoutSession(req);
} catch (e) {
  if (/not configured/i.test(e instanceof Error ? e.message : "")) {
    showToast(t('license.checkoutUnavailable'));
  } else throw e;
}

Prevention

When it happens

Trigger: User clicks 'Upgrade' in a self-hosted build without Supabase env vars; isSupabaseConfigured is false because the client module wasn't initialized; calling createCheckoutSession from a build flavor that omits Supabase.

Common situations: Self-hosted deploy missing VITE_SUPABASE_URL/KEY; dev environment without Supabase configured; the upgrade button rendered despite the licensing backend being unavailable.

Related errors


AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13). Data as JSON: /api/errors/9d8c35a5946c07be. Report an issue: GitHub.