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.

Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools. Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. AUXLE AUXLE I am a Full Stack Developer experienced in building Websites, Web apps and Cross Platform Mobile Apps for Startups and Companies. Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups Victor Denisov Victor Denisov Developer 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. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure

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