fix guide
Bolt app won't publish
Harjot · · updated
You press publish in Bolt and it stalls, shows an error, or finishes and the live site is broken. The preview inside Bolt still looks fine.
The preview and the published site run differently. The preview is a quick test run. Publishing builds the app from scratch on a host, with only the settings that host has. Check these five in order.
1. Build errors
Publishing starts with a build. If the build hits an error, nothing goes live. Read the error text in Bolt's terminal or the host's deploy log, and find the first red line. Later errors often come from it.
Two kinds show up most. TypeScript errors, where a type is wrong but the preview ran anyway. And "Cannot find module" or "Module not found", where the code uses a package that isn't listed in package.json. Paste the first error back to Bolt and ask it to fix that one. If Bolt shows a terminal, run npm run build there to see what the host will see.
Limits can stop a fix too. Bolt plans have token limits, and a large project can use them up faster. If Bolt says you've hit a limit, check your plan usage before you try anything else.
signs The publish step ends in a red error. The deploy log ends on a line that starts with "error", and the live site shows an older version or nothing.
2. Build command and publish directory
The host needs two answers: which command builds the app, and which folder holds the result. For a Vite app, Bolt's usual starting point, the command is npm run build and the folder is dist.
If your host builds the app from GitHub, check both in its build settings. On Netlify they sit under Site configuration. A blank or wrong folder, like build or public, deploys an empty site.
signs The deploy says published but the site shows "Page not found". The log complains about a missing publish folder.
3. Environment variables on the host
Bolt keeps your keys in a .env file for its own preview. Don't assume your host has that file. Copy each name and value into the host's settings. On Netlify that is Site configuration, then Environment variables.
A Supabase app on Vite needs VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY. The names must match the code letter for letter. Values are baked in when the site builds, so start a new deploy after you add them.
signs The site loads but data and sign-in fail. The browser console says "supabaseUrl is required", or a request address has "undefined" in it.
4. The Netlify connection and site claim
If Bolt publishes through Netlify, the link between the two can break. Reconnect Netlify in Bolt's settings and publish again. A stale connection, or a Netlify account you have since changed, can stop publishing. If your project publishes somewhere else, such as Bolt's own hosting, the idea is the same: check the connection to that service.
If Bolt gave you a claim link for a Netlify site, use it so the site belongs to your own Netlify account. Then log in to Netlify and check the site is listed in the team you expect. If it isn't, you may be looking at the wrong account. The settings from steps 2 and 3 live on that site.
signs Publishing fails right away. Or the site you publish to isn't in your Netlify list.
5. Supabase keys and redirect URLs for the new domain
A published app lives on a new address, and a netlify.app address counts as new. Supabase only trusts addresses you list. Open Supabase, then Authentication, then URL Configuration. Set the Site URL to your live address and add it under Redirect URLs. A wildcard like https://yourapp.com/** covers the inner pages.
Check the keys too. The live site must use the URL and public (anon) key of the Supabase project you test against. The service role key never belongs in an app that runs in the browser.
signs Sign-in works in Bolt and lands on the wrong address or an error on the live site. Emails link to the old preview address.
Test it like a new user
- Run npm run build in Bolt's terminal and check it finishes with no errors.
- Publish, then open the live address in a private window.
- Click through two or three pages.
- Sign up with a new email and check the link opens the live address.
- Save something and check it shows up in Supabase.
Common questions
What do I do when Bolt's publish fails with a build error?
Read the first red line in Bolt's terminal or the host's deploy log, since later errors often come from it. Paste that error back to Bolt and ask it to fix that one. If Bolt shows a terminal, run npm run build there to see what the host will see.
What build command and publish folder should a Bolt Vite app use on Netlify?
For a Vite app, the build command is npm run build and the publish folder is dist. Check both in your host's build settings, which on Netlify sit under Site configuration. A blank or wrong folder, such as build or public, deploys an empty site.
Why does my Bolt app load on the live site but data and sign-in fail?
The host probably never received Bolt's .env values. Don't assume it has them: copy each name and value into the host's settings, such as Netlify's Site configuration, then Environment variables. Use the exact names, like VITE_SUPABASE_URL, then start a new deploy.
Still stuck?
Not sure this is the cause? Paste your app's link into the free scan. It lists what a visitor's browser can see, like leaked keys and exposed files, worst first. The score is free; every fix as a prompt for your builder is $9, one-time.
Want a person to look inside? See the diagnosis