r/boltnewbuilders • u/ShipVibed • 8h ago
Tips & Tricks Moving a Bolt app to Netlify or Vercel: 5 things that break on the first deploy (and the fixes)
A lot of people seem to be moving Bolt projects to their own hosting lately, and the first deploy almost always breaks in the same few ways. Here's the list I'd go through before you panic. Assuming the usual Vite + React + Supabase setup.
1. Blank page or "supabaseUrl is required"
Your .env doesn't come along with the GitHub export (and it shouldn't). Add VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in the host's environment variables settings, then trigger a new deploy. Vite bakes these in at build time, so adding them without rebuilding does nothing. And only the anon key goes in a VITE_ var. Anything with that prefix ends up in the public JS bundle, so the service_role key never goes there.
2. Home page works, every other route 404s on refresh
It's a SPA, so the host needs to serve index.html for every path.
- Netlify: create
public/_redirectswith/* /index.html 200 - Vercel:
vercel.jsonwith{ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }
3. Login emails and OAuth send people back to the old URL or localhost
In Supabase go to Authentication > URL Configuration. Set Site URL to your new domain and add https://yourdomain.com/** to Redirect URLs. Also search your code for a hardcoded emailRedirectTo or redirectTo that still points at the old preview URL.
4. Assets 404 and you get a white screen
Check vite.config for a base option. If it's set to some subpath, your JS and CSS get requested from the wrong place. For a normal root domain you want / (or just remove it). Build command npm run build, publish directory dist.
5. CORS errors from edge functions
If your Supabase edge functions set Access-Control-Allow-Origin to the old Bolt domain, every call from the new domain fails. Update it to the new origin and redeploy the functions.
None of this touches your database. If the backend is a Supabase project you own, only the frontend is moving.
Anyone hit something on the move that isn't on this list? Curious what else people ran into.