← All errors · Supabase

supabaseUrl is required

Exact error

Error: supabaseUrl is required.

What it means

createClient() was called with an undefined URL, usually because an environment variable is missing.

Likely causes

How to fix it

  1. Set the variables (Next.js):

    # .env.local
    NEXT_PUBLIC_SUPABASE_URL=https://<project-ref>.supabase.co
    NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-key>
  2. For Vite apps (e.g. Lovable exports), use the VITE_ prefix and import.meta.env:

    const supabase = createClient(
      import.meta.env.VITE_SUPABASE_URL,
      import.meta.env.VITE_SUPABASE_ANON_KEY
    );
  3. Restart the dev server, and add the same vars on Vercel then redeploy.

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy