Cloudflare Pages + Vite troubleshooting

Fix Vite Blank Page on Cloudflare Pages

A blank Vite page usually means JavaScript assets did not load or the build output directory is wrong. Check browser console and dist output.

Common symptoms

  • Deployment is green but page is blank.
  • Console shows failed JS or CSS asset requests.
  • Local npm run preview works.

What to check first

Platform: Cloudflare Pages + Vite
Error: Blank page after deploy

A blank Vite page usually means JavaScript assets did not load or the build output directory is wrong. Check browser console and dist output.

Step-by-step fix

  1. Set build output directory to dist.
  2. Check vite.config.js base if deploying under a subpath.
  3. Open browser devtools and inspect failed asset URLs.
  4. Redeploy after confirming npm run build produces dist.
// vite.config.js
export default {
  base: "/"
}

Common mistake to avoid

Do not debug CSS first if the JS bundle itself is 404.

Still stuck?

Send the deploy log, repository link, target platform, and expected URL. ShipFast Deploy Rescue is a fixed-price debugging service for indie projects and MVPs.