If your Bolt.new app worked in the preview but isn’t working after you publish, the cause is almost always one of a short list: the live site wasn’t updated, the build or redirect settings are wrong, environment variables didn’t make it to the host, or your login settings still point at localhost. Each one has a specific symptom, and most take a few minutes to fix once you know which one you have.
This guide covers both ways Bolt publishes today: Bolt hosting (the default, on a .bolt.host address) and Netlify. Start with the table, then jump to your section.
Which Bolt publishing problem do you have?
| What you see | Most likely cause | Section |
|---|---|---|
| Live site shows an old version | Changes weren’t pushed live | 1 |
| Blank white page | Wrong files deployed, or missing environment variables | 2 |
| Home page works, other pages say “Page not found” | No redirect rule for a single-page app | 3 |
Could not find a build output directory |
Build output is in the wrong place, or the build failed | 4 |
contains no HTML file |
Server-rendered app on static hosting | 5 |
Project is too large to deploy |
Project over 100MB, usually media | 6 |
This site can't be reached or ERR_SSL_PROTOCOL_ERROR |
Your network is blocking .bolt.host |
7 |
Login emails open localhost, Google sign-in fails |
Site URL and redirect list not updated | 8 |
| Data missing after a few quiet days | Database paused for inactivity | 9 |
Before anything else, check the Bolt status page. If there’s an active incident, wait for it to clear and try again.
Why a Bolt app works in preview but breaks when published
Bolt’s preview runs inside your browser, in a sandbox that quietly takes care of building the app, serving every page and holding your keys. A published site is different: it’s a set of finished files on a real server. Anything the preview handled for you now has to be set up properly, and that’s where the gaps show.
The most useful habit when something breaks is to open the live site, press F12 (Cmd+Option+I on a Mac) and read the Console tab. The red error there usually names the problem directly, and it’s far more reliable than describing the symptom to Bolt and hoping it guesses.
1. The live site still shows the old version
Bolt doesn’t push changes to your published site automatically. After you edit the project, click Publish in the top-right corner, then Update. Until you do, visitors keep seeing the version you last published.
If you updated and still see the old version, hard-refresh (Ctrl+Shift+R or Cmd+Shift+R) or open the site in a private window. Your browser may be holding an old copy.
2. Blank white page after publishing
A blank page means the browser got your HTML file but the JavaScript that draws the app didn’t run. The Console tells you why. These are the three causes I’d check, in order.
You deployed the project folder instead of the build
This one mostly hits people who download the project and drag it into Netlify by hand. The console shows something like:
Failed to load module script: Expected a JavaScript module script but the server
responded with a MIME type of "application/octet-stream".
The folder Bolt gives you is source code. Browsers can’t run it as-is; it has to be built first. Build it, then upload only the output folder:
npm install
npm run build
Then drag the dist folder (not the whole project) onto Netlify Drop. Most Bolt projects use Vite, which builds into dist. Older Create React App projects build into build.
The host is serving the wrong folder
If you connected a GitHub repository to Netlify, check the build settings. For a Vite project they should be:
- Build command:
npm run build - Publish directory:
dist
Pointing Netlify at the wrong folder serves an empty page. You can pin these settings in a netlify.toml file at the root of your project so they can’t drift:
[build]
command = "npm run build"
publish = "dist"
Environment variables didn’t reach the host
If the console says something like VITE_SUPABASE_URL is undefined, or supabaseUrl is required, your app’s public settings are missing on the host.
Vite only exposes variables that start with VITE_ to your app, and it bakes their values into the files at build time. So two things have to be true: the variable must exist on the host before the build runs, and you must rebuild after adding it. On Netlify, add them under Site configuration → Environment variables, then trigger a new deploy. Saving a variable doesn’t change a build that already exists.
A small guard makes this failure obvious instead of blank. Put it where your Supabase client is created:
const url = import.meta.env.VITE_SUPABASE_URL;
const key = import.meta.env.VITE_SUPABASE_ANON_KEY;
if (!url || !key) {
throw new Error(
"Missing VITE_SUPABASE_URL or VITE_SUPABASE_ANON_KEY. Set them on your host and redeploy."
);
}
One warning: anything in a VITE_ variable ends up in the browser, where anyone can read it. Vite’s own docs say not to put API keys there. The Supabase public (anon) key is designed to be public. An OpenAI, Stripe secret or other private key is not. More on that in keys that work in preview below.
3. Every page except the home page shows “Page not found”
What it looks like: clicking around the live site works, but refreshing /dashboard, or opening a shared link to it, gives “Page not found”.
Why it happens: most Bolt apps are single-page apps. There’s one real HTML file, index.html, and the app’s router draws every other page in the browser. When someone opens /dashboard directly, the server looks for a file at that address, doesn’t find one, and returns a 404.
How to fix it: add a redirect rule that sends every address to index.html. Create a file called _redirects (no file extension) in the public folder, so the build copies it into dist:
/* /index.html 200
If your project has a netlify.toml, add the same rule there instead:
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Then click Publish → Update (or redeploy on Netlify), open a page other than the home page and refresh it to check.
4. “Could not find a build output directory”
When you publish, Bolt builds your project and then looks for the folder the finished files went into, usually dist or build. If it can’t find that folder, publishing stops with Could not find a build output directory to publish.
Your code isn’t lost. Either the build failed before creating the folder, or it put the files somewhere unexpected. To find out which, open the terminal in Bolt and run npm run build yourself. If it fails, the real error is in the output: a missing package, a typo the AI introduced, or an import whose capitalisation doesn’t match the file name. Fix that first.
If the build succeeds, look at where it wrote the files (Vite’s outDir setting in vite.config.ts controls this) and make sure it’s the folder Bolt expects. You can also paste the error into the chat and ask Bolt to check how the project builds and fix it.
5. “Contains no HTML file” when publishing
This error looks like: The build finished, but "<folder>" contains no HTML file, so the published site would show only 404 pages.
It means your app is server-rendered: it builds pages on a server each time someone opens them. Bolt hosting serves pages that are already built as HTML files, so apps built with TanStack Start, SvelteKit, Remix or Astro in server mode need to change how they build. Next.js apps are the exception, because Bolt hosting supports server rendering for Next.js.
You have two options:
- Build a static site. Ask Bolt to change the build to output static HTML, using SPA mode or prerendering. Bolt’s docs suggest a prompt along these lines: “Publishing fails with ‘contains no HTML file.’ Change this project so the build outputs static HTML files, using SPA mode or prerendering.”
- Move server code into server functions. If your app has code that must run on a server, such as code using a secret API key, ask Bolt to move it into server functions first, so switching to static doesn’t push that code into the browser.
If your app really needs server rendering and isn’t Next.js, it needs a host that can run a server. That’s usually the point where it’s worth having a developer move it.
6. “Project is too large to deploy”
Bolt projects must be under 100MB to publish. The error reads Project is too large to deploy. The maximum allowed size is 100MB. This is the size of your project files, which is a different limit from Bolt’s chat context.
The cause is nearly always images and video stored inside the project. To fix it:
- Download the project as a backup and check the folder size.
- Ask Bolt to find and delete images and videos the project doesn’t use (old versions of uploads pile up).
- If it’s still too big, move your media to a storage service such as Supabase Storage, Cloudflare R2 or Cloudinary, ask Bolt to load each file from its new URL, then delete the local copies.
Serving media from storage also makes the site faster, so this is worth doing even before you hit the limit.
7. “This site can’t be reached” on a .bolt.host address
Two errors here look alarming but usually aren’t your app’s fault:
DNS_PROBE_FINISHED_NXDOMAINorDNS_PROBE_FINISHED_BAD_CONFIG: your device or network can’t look up the address.ERR_SSL_PROTOCOL_ERRORwith “This site can’t provide a secure connection”: a network security filter is blocking the uncommon.bolt.hostdomain.
Your site has probably published fine. Test it on your phone’s mobile data with Wi-Fi and any VPN turned off. If it loads there, the problem is your network. On Android, also check Private DNS in Settings and set it to Automatic. Republishing won’t help.
The catch is that your customers may hit the same block on their own networks. If your app is for real users, connect a custom domain (available on paid Bolt plans). It’s more trustworthy for users anyway, and filters rarely block a normal .com.
8. Login links go to localhost or Google sign-in fails
What it looks like: sign-up works, but the confirmation email opens localhost:3000 or a dead page. Password reset does the same. Google sign-in fails or loops.
Why it happens: sign-in emails and redirects use a Site URL setting, and new Bolt projects start with localhost:3000. Bolt usually updates it when you publish, but not always, and never for a custom domain or second domain it doesn’t know about.
How to fix it on Bolt Database: click the database icon at the top of the screen, then Authentication:
- Set Site URL to your main live address, for example
https://yourapp.com. - Add every address users can return to into the URI Allow List, for example
https://yourapp.com/**andhttps://your-site.bolt.host/**.
If you connected your own Supabase project, the same settings live in the Supabase dashboard under Authentication → URL Configuration (Site URL and Redirect URLs).
For Google sign-in, Google’s own console also needs your callback URL on its list of authorised redirect URIs. And test Google sign-in on the published site, not the preview: Google blocks its sign-in flow inside iframes, and Bolt’s preview is one.
Then test the whole flow with a brand-new email address. An account you created weeks ago won’t show you what a new user sees.
9. The app loads, but the data is gone or slow
If your app shows no data, or takes a long time on the first load after a quiet spell, check whether the database was paused.
Bolt can pause a Bolt Database that has had low usage for six days or more. Databases behind a live, Bolt-hosted site aren’t paused for inactivity, but unpublished projects and projects published on Netlify can be. When you open the project in Bolt, it restores the database automatically, which can take a few minutes. If you use your own Supabase project, Supabase’s rules apply instead: its Free plan pauses projects after a week of low activity.
The fix is simple: publish with Bolt hosting if you’re using Bolt Database, or move to a paid Supabase plan if you’re on your own Supabase project and have real users. An app that goes dark after a quiet week isn’t something to launch with.
Features that call an API work in preview but not live
If AI features, emails or payments work in the preview but fail on the live site, look at where the key lives.
Bolt’s Secrets (database icon → Secrets) only work with server functions. Bolt passes a secret’s value to your server functions and never writes it into your project’s files, the code that runs in your users’ browsers, or your published site. So if your frontend code reads a key directly, it will be missing on the live site, and that’s deliberate.
Don’t fix that by putting the key in a VITE_ variable. That would publish it to every visitor, and a leaked OpenAI or Stripe key gets abused fast. Ask Bolt to move the call into a server function that reads the secret, and have the frontend call that function instead.
While you’re there, check who can read your data. Bolt apps talk to their database from the browser, so row-level security has to be on for every table. My Lovable data leak check walks through the same tests, and they work for any Supabase-backed app.
When to stop prompting and bring in a developer
The fixes above are mostly settings, and the Console usually tells you which one. Asking Bolt to “fix the deployment” without the error message tends to burn tokens: it can’t see your host’s settings or your browser console, so it guesses.
It’s worth bringing in help when:
- the build fails and each AI fix breaks something else,
- your app needs server rendering, or has secret keys in frontend code that have to move server-side,
- you’re moving off Bolt hosting, onto your own Supabase project or a custom domain, and don’t want to lose users or data,
- real customers are using the app and you need it fixed today, not after another round of prompts.
I fix and launch Bolt.new apps: deployment, auth, payments, database security and moving to your own infrastructure when you’re ready. See how I fix Bolt.new apps, or send me the error you’re seeing and I’ll tell you what it’ll take. If you’re comparing builders, the same problems show up in Lovable too; I covered those in common Lovable app issues.
FAQ
Why does my Bolt.new app work in preview but not when published?
Bolt’s preview runs in your browser and quietly handles building, routing and keys. A published site is a set of built files on a server, so missing redirect rules, environment variables, auth URLs and secrets all show up at once. The browser console on the live site usually names the exact cause.
Does Bolt update my published site automatically?
No. After you change your project, click Publish, then Update to push the new version live. Until then, visitors see the version you last published.
Should I host my Bolt app on Bolt hosting or Netlify?
Bolt hosting is the default and the simplest, and it keeps a Bolt Database from being paused for inactivity. Netlify gives you more control over builds and settings. You can switch between them in Project settings → Domains & Hosting, but custom domains don’t carry over automatically, so you’ll need to repoint yours.
Why does my Bolt site work on my phone but not on my Wi-Fi?
Your network or internet provider is probably blocking the .bolt.host domain, or your device’s DNS can’t look it up. The site itself is fine. A custom domain avoids the problem for your users.
Where do I put API keys in a Bolt app?
In Secrets, used from a server function. Never in a VITE_ variable or in frontend code, because those end up in every visitor’s browser.
Further reading
- Publishing issues (Bolt support)
- Publish your project to a live website (Bolt support)
- Netlify for hosting (Bolt support)
- Database authentication settings (Bolt support)
- Secrets (Bolt support)
- Deploy your Bolt app to Netlify (Netlify)
- Env variables and modes (Vite docs)