Supabase error EntityTooLarge (Upload Exceeds Maximum Object Size) explained: what it means, why it happens, and how to fix it — with copy-paste code examples.
Check file.size <= 52428800 bytes before calling upload(). If that does not apply, compress images (WebP/AVIF) or transcode video before upload — the full checklist is below.
Error code: EntityTooLarge
Official name: Upload Exceeds Maximum Object Size
Service: Supabase
Your proposed upload exceeds the maximum allowed object size.
function assertUploadable(file) {
const MAX_BYTES = 50 * 1024 * 1024 // 50 MB
if (file.size > MAX_BYTES) {
throw new Error('File exceeds the 50 MB storage limit')
}
}
assertUploadable(file)
await supabase.storage.from('uploads').upload(file.name, file)
Catching the 50 MB limit before the request keeps users out of 413-error territory.
Validate size client-side so users see a friendly error instead of a 413.
const MAX = 50 * 1024 * 1024 // 50 MB
if (file.size > MAX) {
showError('File must be under 50 MB')
return
}
await supabase.storage.from('uploads').upload(path, file)
Most often this happens when uploading a file larger than the 50 MB per-object storage limit, or when video or asset uploads bypassing client-side size checks.
Check file.size <= 52428800 bytes before calling upload().
This page documents fixes for: supabase-js.
Recommendations are editorial — DB Error Reference takes no payment or affiliate fees for tool listings.
This page is based on the official Supabase documentation linked below and adds practical troubleshooting guidance on top.