← All errors · SupabaseSupabase auth errors
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
- Env var not set, misspelled, or not prefixed NEXT_PUBLIC_ / VITE_ for browser code.
- Env var missing in Vercel project settings.
- Dev server not restarted after editing .env.
How to fix it
Set the variables (Next.js):
# .env.local NEXT_PUBLIC_SUPABASE_URL=https://<project-ref>.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-key>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 );Restart the dev server, and add the same vars on Vercel then redeploy.
Still stuck after trying this? Get it fixed for $49, or you don't pay.
Prevent this next time
- Configure custom SMTP before launch so auth emails are not limited by the built-in test sender.
- Test signup, login, password reset and email confirmation on a staging project after every auth change.
FAQ
What does "supabaseUrl is required" mean?
createClient() was called with an undefined URL, usually because an environment variable is missing.
What usually causes it?
Env var not set, misspelled, or not prefixed NEXT_PUBLIC_ / VITE_ for browser code. Env var missing in Vercel project settings. Dev server not restarted after editing .env.
How do I fix it?
1. Set the variables (Next.js): 2. For Vite apps (e.g. Lovable exports), use the VITE_ prefix and import.meta.env: 3. Restart the dev server, and add the same vars on Vercel then redeploy.
Related errors
More Supabase errors and fixes →
Tools that help
- Railway: Deploy backends and databases; new users get $20 credit.
Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy