Blog ·

Sign-up does nothing on your live site? Check your environment variables

You built your app with Lovable, Bolt, Cursor or Replit, moved it to your own hosting such as Vercel or Netlify, and the live site looks right. Then someone tries to sign up and nothing happens. Or the whole page is blank. In the preview it all worked.

A common cause is that your app's settings, such as your Supabase project address and key, never reached the live build. They are called environment variables, and in apps like these they are read when the app is built, not when someone visits it.

The short answer

Your app reads values like VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY from the environment. In your AI tool's preview those are set for you. On your own host they only exist if you add them there, with the exact same names, for the Production environment, and then build the site again.

If any of that is missing, the browser code gets an empty value. The Supabase JavaScript library then stops with the error supabaseUrl is required. or supabaseKey is required., and sign-up, login and anything else that talks to your database stop working.

How to tell if this is your problem

Open your live site in a browser, open the developer tools (F12 on most computers), go to the Console tab and reload the page. Then try to sign up. Look for:

  • supabaseUrl is required. or supabaseKey is required.
  • an error that mentions undefined near your Supabase setup code

If you see one of these on the live site but not in the preview, the steps below are for you.

Why it works in preview but not live

Two rules catch people out.

The values are baked in when the app is built. Vite's docs say these values are statically replaced at build time. Next.js says the same about its browser values: after the app is built, it no longer responds to changes to them. Lovable's hosting guide puts it plainly: variables that start with VITE_ are embedded at build time, not runtime. So adding a value to your host does nothing for the version that is already live.

Only names with the right prefix reach the browser. In a Vite app, which includes older Lovable projects, only variables whose names start with VITE_ are exposed to the browser code. Vite's own example shows a variable called DB_PASSWORD coming back as undefined. In a Next.js app the prefix is NEXT_PUBLIC_ instead. A variable called SUPABASE_URL is invisible to the browser code in either kind of app.

Fix it in four steps

  1. Find the exact names your code reads. Search your project for import.meta.env (Vite) or process.env.NEXT_PUBLIC_ (Next.js). Copy each name exactly. For a Lovable app that uses the built-in backend, Lovable lists VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY and VITE_SUPABASE_PROJECT_ID, and says the values are in the .env file in Lovable's code editor or in your synced GitHub repository.
  2. Add them on your host, for Production. On Vercel, open your project, then Environment Variables, enter each name and value, and choose which environments it applies to. Vercel applies a Production variable to your next Production deployment, so tick Production. On Netlify, use Project configuration, then Environment variables. Netlify notes that its build system does not read .env files, so a .env file in your repository is not enough there.
  3. Build and deploy again. Vercel's docs say changes to environment variables only apply to new deployments, and you must redeploy to pick them up. Netlify says changes need a build and deploy to take effect. Saving the value is not the last step.
  4. Test sign-up on the live site in a private browser window, with the Console open, and check the error has gone.

Lovable apps created from 13 May 2026

Lovable says projects created from 13 May 2026 use TanStack Start and run server code. For those, Lovable's guide lists two sets of values: VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY for the browser, and SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY for the server, plus any secrets your server functions read, which are not in the repository. Add both sets on your host. To check which kind of project you have, Lovable says to open package.json: a TanStack Start project lists @tanstack/react-start under its dependencies.

Which key is safe to put in a browser variable

Anything with a VITE_ or NEXT_PUBLIC_ name ends up in the code your visitors download, so only put values there that are meant to be public.

Supabase's docs say the publishable key (it starts with sb_publishable_, or the older anon key) is safe to expose in a web page, because Row Level Security decides what it can reach. The secret key (sb_secret_, or the older service_role key) bypasses Row Level Security and must never go in a browser or in your code. Never give it a VITE_ or NEXT_PUBLIC_ name. Supabase also says a secret key doesn't work in a browser anyway: it returns 401 Unauthorized.

Supabase's Connect dialog, or Settings, then API Keys in your Supabase dashboard, shows your project address and keys.

A prompt you can paste into your AI tool

"My app works in preview, but on my live site sign-up does nothing and the browser console shows supabaseUrl is required. List every environment variable this project reads in browser code, with its exact name and prefix, and tell me which ones are safe to be public. Don't put any secret key in browser code, and don't change anything else."

Then add the values on your host yourself and redeploy. Don't paste secret keys into a chat.

Catch silent breaks before your users do

This kind of break is easy to miss because the preview keeps working. Scheduled testing from FlowCanary is launching by 30 November 2026. Once it is live, it will test the flows a new visitor can do in your app, such as sign-up and checkout, in a real browser on a schedule, with logged-in flows on Pro, and tell you in plain English when one breaks, with a fix prompt for Lovable, Bolt, Cursor or Replit. Until then, the free check works today: paste your live URL and it opens the page in a real browser and reports JavaScript errors, failed requests and blank pages.

Sources

Run the free checker