Supabase error NoSuchBucket (Storage Bucket Not Found) explained: what it means, why it happens, and how to fix it — with copy-paste code examples.
Create the bucket first with supabase.storage.createBucket('name'). If that does not apply, verify the bucket id via storage.listBuckets() — the full checklist is below.
Error code: NoSuchBucket
Official name: Storage Bucket Not Found
Service: Supabase
The specified bucket does not exist.
const { error } = await supabase.storage.from('avatars').upload(path, file)
if (error?.code === 'NoSuchBucket') {
await supabase.storage.createBucket('avatars', { public: true })
// retry the upload
}
Guard the 404 so a missing bucket does not fail the whole upload flow.
Create the bucket on first use and handle NoSuchBucket gracefully.
const { data: buckets } = await supabase.storage.listBuckets()
if (!buckets.some(b => b.id === 'avatars')) {
await supabase.storage.createBucket('avatars', { public: true })
}
Most often this happens when uploading to a bucket id that was never created, or when bucket deleted while objects still referenced.
Create the bucket first with supabase.storage.createBucket('name').
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.