Hire Lovable Xperts
Migration

How to Move a Lovable App to Vercel

Deploying a Lovable app to Vercel takes about an hour for a simple project. Four steps most guides skip: copying every VITE_ environment variable, confirming Supabase RLS allows your new Vercel domain, replicating edge functions, and triggering a password reset before DNS cutover. Miss any of these and your first live deploy returns a blank page or a 401.

By Founder Name · Last verified: 2026-06-24

Before you start: what you need ready

Before touching Vercel, inventory everything your app depends on. A missed environment variable or skipped Supabase origin update will cause a silent failure on first deploy that wastes an hour of debugging. Run through this checklist before you open the Vercel dashboard.

  1. Confirm Lovable preview is working and all features are stable — don't migrate a broken app.
  2. Open Lovable Project Settings → Environment and list every variable (VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY, and any VITE_STRIPE_* or other keys).
  3. Confirm your GitHub repo exists and Lovable is connected — check Project Settings → GitHub.
  4. Note your Supabase project reference (the alphanumeric string in your project URL at supabase.com).
  5. If your app takes payments, note your Stripe webhook endpoint URL — you will need to update it after DNS cutover.
  6. Decide whether you are keeping the same Supabase project (easiest) or migrating to a new one (requires extra steps).

How does Vercel compare to Cloudflare and Netlify for a Lovable app?

Vercel is the most popular destination for Lovable apps because it auto-detects Vite and React, offers instant rollbacks, and has a generous free tier. The key differences versus the other two hosts are runtime model and build-time env-var scoping — both matter for Lovable apps that rely on VITE_ prefixed variables baked in at build time.

Vercel vs Cloudflare Pages vs Netlify for a Lovable/Vite app
FeatureVercelCloudflare PagesNetlify
Framework auto-detectVite + React (auto)Vite (auto, sometimes needs override)Vite + React (auto)
Build command defaultnpm run buildnpm run buildnpm run build
Output directorydist (Vite default)dist (must confirm)dist (must confirm)
VITE_ env vars at buildYes — set in Project SettingsYes — set per environmentYes — set in Site Config
Preview URLs*.vercel.app per branch*.pages.dev per deploy*.netlify.app per deploy
Instant rollbackYes (one click)Re-deploy previousYes (one click)
Free tier bandwidth100 GB/mo (hobby)Unlimited100 GB/mo
Server-side functionsVercel Functions (Node.js)Workers (V8 isolates)Netlify Functions (Node.js)
Custom domainsYes, automatic SSLYes, via Cloudflare DNSYes, automatic SSL

How do I connect my Lovable project to GitHub?

In the Lovable editor, open Project Settings and navigate to the GitHub section. Connect your GitHub account and create a new repository or link an existing one. Lovable will push your current code there. All future changes you make in Lovable will be committed automatically to that branch.

  1. Open your Lovable project and click the Settings gear icon.
  2. Select GitHub Integration → Connect GitHub Account.
  3. Authorise the Lovable GitHub app when prompted.
  4. Create a new repository or select an existing one.
  5. Click Push to confirm. The initial push may take 30–60 seconds.

How do I deploy the GitHub repo to Vercel?

Once the repository exists, go to vercel.com, import the repo, and let Vercel auto-detect the Vite or React build settings. You will be prompted to add environment variables before the first deploy — this is where most migrations break if you skip the env-var step.

  1. Log in to vercel.com and click Add New Project.
  2. Select Import Git Repository and pick your Lovable repo.
  3. Vercel auto-detects Vite/React. Confirm the Framework Preset is Vite (or React if Vite is not shown).
  4. Before clicking Deploy, go to Environment Variables and add every variable from Lovable Project Settings → Environment.
  5. The critical ones: VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.
  6. Click Deploy. The first build typically takes 60–90 seconds.

Why does my Vercel deploy show a blank page?

A blank page on the first Vercel deploy almost always means one or more VITE_ environment variables are missing. Vercel builds the app at deploy time — if the variables are not present, the Supabase client cannot initialise and the app renders nothing. Open the Vercel build logs, search for 'undefined', and confirm each variable is set.

After adding the missing variables in Vercel, trigger a redeploy: go to Deployments → the latest deploy → Redeploy. This forces a fresh build with the new environment. Do not just refresh the browser — the app is baked at build time, so a new build is required.

Environment variables set in Lovable are NOT automatically transferred to Vercel. You must add them manually in Vercel Project Settings → Environment Variables.

Common Vercel deploy errors and fixes

Most Lovable-to-Vercel migration failures fall into a small set of repeating error patterns. The table below maps the error you see in the browser or Vercel build log to the most likely cause and the fastest fix. Work through these before opening a support ticket.

Vercel deploy error → cause → fix
Error / SymptomMost likely causeFix
Blank white page after deployVITE_ env vars missing at build timeAdd all VITE_ vars in Vercel → Project Settings → Environment Variables, then redeploy
401 on all Supabase requestsNew Vercel domain not in Supabase allowed originsAdd *.vercel.app URL to Supabase → Authentication → URL Configuration → Redirect URLs
CORS error on auth callbackSupabase Site URL still points to Lovable domainUpdate Supabase → Authentication → URL Configuration → Site URL to your Vercel URL
404 on all page reloads (SPA routes)Vercel not configured for client-side routingAdd a vercel.json with: {"rewrites": [{"source": "/(.*)", "destination": "/index.html"}]}
Build fails: Cannot find module '@/...'Path alias not resolved — missing vite.config.ts aliasConfirm resolve.alias in vite.config.ts: { '@': path.resolve(__dirname, './src') }
Stripe webhooks stop firingWebhook URL still points to old Lovable domainUpdate the webhook endpoint in Stripe Dashboard → Developers → Webhooks to your new domain
Users cannot log in after DNS cutoverAuth password hashes not portable across Supabase projectsTrigger password-reset emails for all users before DNS cutover — hashes cannot be migrated
Environment variables work in Preview but not ProductionVariables set for Preview environment onlyIn Vercel → Project Settings → Environment Variables, set each var for Production, Preview, and Development

How do I update Supabase to allow my Vercel domain?

Supabase auth restricts which origins can authenticate users. After deploying to Vercel, you must add your *.vercel.app URL and your custom domain to the Supabase allowed-origins list. Skipping this step causes all auth calls to return 403 or redirect incorrectly, even when env vars are correct.

  1. In the Supabase dashboard, open Authentication → URL Configuration.
  2. Add https://<your-project>.vercel.app to Site URL or Redirect URLs.
  3. After DNS cutover, add your real domain (e.g., https://myapp.com).
  4. Save and redeploy on Vercel (or wait for the next deploy trigger).

What about Supabase edge functions and auth password hashes?

Edge functions live in your Supabase project, not in Lovable's hosting — so they continue to work as long as you are using the same Supabase project. Auth password hashes, however, cannot be exported. If you are migrating users to a new Supabase project, trigger a password-reset email for all users before DNS cutover so no one is locked out.

How do I point my custom domain to Vercel?

In Vercel, go to your project's Domains settings and add your custom domain. Vercel will show you a CNAME or A record to add in your DNS provider. SSL is provisioned automatically via Let's Encrypt, usually within minutes of the DNS change propagating. Keep your Lovable-hosted URL running until DNS propagation is complete.

  1. In Vercel, open Project → Settings → Domains → Add.
  2. Enter your domain (e.g., myapp.com) and click Add.
  3. Copy the CNAME or A record Vercel provides.
  4. In your DNS provider, add the record. TTL of 300 speeds propagation.
  5. Wait for propagation (usually 5–30 minutes) and verify HTTPS loads.
  6. Update Supabase allowed origins to include your new domain.

How do I roll back if the Vercel migration breaks?

Vercel keeps every deploy permanently and lets you promote any previous build to production in one click — no new build required. If your DNS cutover goes wrong, you can switch back to the last stable build in seconds while you diagnose the root cause, then re-cut DNS once the issue is resolved.

  1. In Vercel, go to your project → Deployments.
  2. Find the last known-good deployment and click the three-dot menu → Promote to Production.
  3. If the issue is purely DNS (not a code or env-var problem), revert your CNAME or A record in your DNS provider while Vercel serves the old build.
  4. Once stable, check Vercel build logs and env-var settings before re-attempting cutover.
DNS changes take 5–30 minutes to propagate. During that window both old and new hosts may serve traffic. Wait for full propagation before concluding something is broken.

Post-migration smoke test for Vercel

A successful Vercel build is not the same as a working app. Run this checklist against your *.vercel.app preview URL before cutting DNS — Vercel keeps every preview URL permanently, so you can test the full stack including auth, Supabase data, and Stripe webhooks without exposing anything to live users.

  1. Sign up with a new test account — confirm the confirmation email arrives and the account activates.
  2. Sign in with an existing account — confirm the Vercel deployment's Supabase session persists across page reloads.
  3. Reload a nested route directly (e.g., /dashboard/settings) — confirm Vercel's SPA rewrites serve index.html instead of a 404.
  4. If your app uses payments, trigger a Stripe test charge and confirm the webhook URL now points to the Vercel domain.
  5. Check the browser console for errors about undefined env vars — the most common Vercel-specific cause of a silent blank page.
  6. Verify HTTPS is active on your custom domain after DNS propagation and that the Supabase Site URL is updated.

Frequently asked questions

Will Vercel auto-deploy when I make changes in Lovable?
Yes, if Lovable is connected to your GitHub repo, every change you make in Lovable commits to the repo, and Vercel's GitHub integration triggers a new deploy automatically. This is the most popular workflow for teams who want to keep using Lovable for development but host on Vercel.
Do I need a paid Vercel plan?
The Vercel hobby tier is free and supports custom domains and HTTPS. It has limits on serverless function execution time and team members. Most Lovable apps work fine on the hobby tier. Only move to Pro if you need team collaboration or more generous compute limits.
What if my Lovable app uses Supabase edge functions?
Edge functions are deployed to Supabase, not Lovable. As long as you are using the same Supabase project, they continue to work after you move to Vercel. No action needed beyond confirming env vars are set correctly.
Can I roll back to Lovable hosting if something goes wrong?
Yes. Lovable continues hosting your app until you cancel your subscription or explicitly delete the project. Keep DNS pointing at Lovable until your Vercel deploy passes a full smoke test — then cut over. You can always revert the DNS record if something breaks.
Why do my environment variables work in preview deploys but not in production?
Vercel scopes environment variables to Preview, Production, and Development separately. If you only set them for Preview, production builds run without them. In Vercel → Project Settings → Environment Variables, set every VITE_ variable for all three environments.
How do I handle Stripe webhooks after moving to Vercel?
Stripe webhooks are tied to your domain URL. After DNS cutover to your new domain on Vercel, update the webhook endpoint in the Stripe Dashboard under Developers → Webhooks. During the cutover window, run both the old and new endpoints in parallel to avoid missed events.
My users can't log in after the migration. What went wrong?
Two possible causes: the Supabase Site URL or Redirect URLs still point to the old Lovable domain, or you moved to a new Supabase project without triggering password resets. Check Supabase → Authentication → URL Configuration first. If the URLs are correct, the issue is almost certainly missing auth allowed origins.
What is the difference between a Vercel redeploy and a new deploy?
A redeploy rebuilds the same commit with the current environment variables — useful after adding missing env vars. A new deploy triggers from a new git commit. If you add environment variables and want them to take effect immediately, use Redeploy (not a new commit) so you don't pollute git history with a no-op change.
Can I use Vercel with a monorepo that includes my Lovable project?
Yes. Vercel supports monorepos — set the Root Directory in Vercel project settings to the subdirectory containing your Lovable app's package.json. The build command and output directory settings apply relative to that root.
How do I test my Vercel deploy without affecting live users?
Every Vercel deployment gets a permanent *.vercel.app URL that stays live forever — even after DNS cutover. Use that URL to run a full smoke test (auth, data reads, Stripe) before updating your DNS records. You can share the preview URL with your team for review without exposing it to end users.

Talk to a senior engineer — not a salesperson.

Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.

Book a free audit call