Lovable deployment

Supabase Storage Bucket CORS Error on Upload

File upload to Supabase Storage fails with CORS error. 'Access-Control-Allow-Origin' missing in response. Works with API key but not with RLS. Uploads blocked from production domain.

Supabase Storage requires CORS configuration and proper bucket settings for client-side uploads.

Error Messages You Might See

Access-Control-Allow-Origin header is missing CORS policy does not allow access No such bucket
Access-Control-Allow-Origin header is missingCORS policy does not allow accessNo such bucket

Common Causes

  1. Bucket CORS not configured in Supabase
  2. Domain not added to allowed origins
  3. Not using public bucket when needed
  4. Trying to use private bucket with expired token
  5. RLS policy blocks upload operation

How to Fix It

Configure CORS in Supabase dashboard > Storage > Buckets > select bucket > CORS policy:

[
  {
    "origin": ["https://yourdomain.com"],
    "methods": ["GET", "POST", "PUT", "DELETE"],
    "allowedHeaders": ["*"]
  }
]

Use signed URLs for private uploads or public bucket for direct uploads.

Real developers can help you.

Meïr Ankri Meïr Ankri Full-stack developer specializing in React / Next.js / Node.js with 6+ years of experience. I've worked across various sectors including automotive (Reezocar/Société Générale), healthcare (Medical Link SaaS), and e-commerce (Glasman). I build web apps end-to-end, from architecture to production, with a focus on scalability, performance, and code quality. I also mentor junior developers and contribute to technical decisions and code reviews. Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Victor Denisov Victor Denisov Developer 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. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups 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. legrab legrab I'll fill this later

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

Should I use public or private bucket?

Public: direct browser uploads with CORS. Private: use signed URLs or server-side uploads.

How long are signed URLs valid?

Configurable from seconds to days. Default is reasonable but set based on your needs.

Related Lovable 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