Bolt.new deploy failed (or broken) on Netlify: read the log and fix the real error

By AI App Medic · Updated · Bolt · Netlify · Deploy

Bolt.new runs your app inside a Node environment in the browser (StackBlitz WebContainers). Netlify builds the same code on a Linux build image. Most "works in Bolt, fails on Netlify" problems come from that difference. The fix starts with the deploy log, specifically the first error, not the last line.

Find the real error

  1. Netlify > your site > Deploys > click the failed deploy.
  2. Scroll up from the bottom until you find the first line in red. Lines after it are usually consequences.
  3. Before changing anything, run npm run build in Bolt's terminal. If it fails there too, fix that first.

Common errors and fixes

Log saysCauseFix
Module not found: Can't resolve './components/Header'File missing, or letter case differs (header.tsx vs Header). Linux is case-sensitive.Make the import match the file name exactly.
TypeScript errors like TS2322, TS2345Your build script runs the type checker (for example tsc && vite build).Fix the listed type errors one by one. Removing the type check hides bugs.
ERESOLVE unable to resolve dependency treeConflicting peer dependency versions.Align the package versions. As a temporary workaround set NPM_FLAGS=--legacy-peer-deps in Netlify's environment variables.
Syntax or engine errors in Node itselfDifferent Node version.Pin it: add an .nvmrc file containing e.g. 20, or set NODE_VERSION in Netlify.
Deploy directory 'dist' does not existPublish directory and build output do not match.Use build command npm run build and publish directory dist for Vite.
Build succeeds, live page blankMissing VITE_ env vars at build time.Add them in Netlify and redeploy. See blank page fixes.
Build succeeds, refresh gives 404No SPA fallback.Add public/_redirects with /* /index.html 200. See 404 on refresh.

A clean netlify.toml for a Bolt (Vite) app

[build]
  command = "npm run build"
  publish = "dist"

[build.environment]
  NODE_VERSION = "20"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

When the live site loads but features fail

Once it is live, run a free health scan to check for exposed keys and missing security headers before you share the link. If the deploy is green but the app is blank or prints undefined for your Supabase URL, the usual cause is missing env values: Bolt works in preview, breaks on Netlify.

FAQ

Where do I find the error for a failed Bolt deploy?

In Netlify open the site, go to Deploys, click the failed deploy and scroll to the first red error in the log. Inside Bolt, the publish output panel shows the same build output.

Why does it build in Bolt but fail on Netlify?

Bolt runs your project in a browser-based Node environment. Netlify builds on Linux with its own Node version, so version differences, case-sensitive file names and missing env vars show up only there.

The build succeeded but the site is blank. Now what?

That is usually missing VITE_ environment variables or the wrong publish directory. See our blank page guide.

Related guides