Bolt storage

File Upload Broken After Deploying Bolt App to Production

File uploads in your Bolt.new application work perfectly during development in the WebContainer but fail completely after deploying to production. Users see upload spinners that never finish, error messages about failed requests, or files that appear to upload but are never saved.

This is one of the most common deployment issues with Bolt apps because the WebContainer environment handles file storage differently than production hosting. Files stored locally during development have no persistent storage on serverless platforms like Vercel or Netlify.

The issue can manifest in several ways: uploads timeout with 413 or 504 errors, files are saved but disappear after deployment redeploys, or the upload endpoint returns CORS errors that didn't exist in development.

Error Messages You Might See

413 Request Entity Too Large Error: ENOENT: no such file or directory, open '/tmp/uploads/...' 504 Gateway Timeout during file upload StorageApiError: new row violates row-level security policy TypeError: Failed to fetch (upload request)
413 Request Entity Too LargeError: ENOENT: no such file or directory, open '/tmp/uploads/...'504 Gateway Timeout during file uploadStorageApiError: new row violates row-level security policyTypeError: Failed to fetch (upload request)

Common Causes

  • Local file system storage in serverless — Bolt generated code that saves files to the local filesystem (fs.writeFile), which is ephemeral on serverless platforms
  • Missing cloud storage configuration — No Supabase Storage, AWS S3, or Cloudinary configuration for production file hosting
  • File size limits on hosting platform — Vercel limits request body to 4.5MB, Netlify to 1MB by default, causing large uploads to silently fail
  • CORS not configured on storage bucket — The cloud storage bucket doesn't allow uploads from your production domain
  • Missing multipart form parsing — The API route doesn't parse multipart/form-data correctly in the production runtime

How to Fix It

  1. Switch to cloud storage — Replace local filesystem storage with Supabase Storage: const { data, error } = await supabase.storage.from('uploads').upload(filePath, file)
  2. Configure upload size limits — For Vercel, add to vercel.json: { "functions": { "api/**": { "maxDuration": 60 } } } and use streaming uploads for large files
  3. Set up CORS on storage bucket — In Supabase dashboard, configure the storage bucket to allow your production domain origin
  4. Use presigned URLs for large files — Generate a presigned upload URL on the server and upload directly from the browser to storage, bypassing your API
  5. Add proper error handling — Wrap upload logic in try-catch and return meaningful error messages instead of generic 500 errors

Real developers can help you.

Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Mehdi Ben Haddou Mehdi Ben Haddou - Founder of Chessigma (1M+ users) & many small projects - ex Founding Engineer @Uplane (YC F25) - ex Software Engineer @Amazon and @Booking.com Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. PawelPloszaj PawelPloszaj I'm fronted developer with 10+ years of experience with big projects. I have small backend background too Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Why do uploads work locally but not in production?

In Bolt's WebContainer, files are stored in the local filesystem which is always available. In production on serverless platforms (Vercel, Netlify), the filesystem is read-only or ephemeral. You need to use cloud storage like Supabase Storage or AWS S3.

What is the maximum file size I can upload on Vercel?

Vercel's serverless functions have a 4.5MB request body limit. For larger files, use presigned URLs to upload directly to your storage bucket from the browser, bypassing the serverless function entirely.

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help