Supabase Error NoSuchBucket: Storage Bucket Not Found

Supabase error NoSuchBucket (Storage Bucket Not Found) explained: what it means, why it happens, and how to fix it — with copy-paste code examples.

Error code NoSuchBucket Supabase Last verified 2026-08-19

Quick Answer

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

Error code: NoSuchBucket
Official name: Storage Bucket Not Found
Service: Supabase

What does this error mean?

The specified bucket does not exist.

Common Causes

How to Fix

  1. Create the bucket first with supabase.storage.createBucket('name')
  2. Verify the bucket id via storage.listBuckets()
  3. Use the bucket id (not the display name) in from()
  4. If the bucket was deleted, re-create it and restore objects from backup

Code Examples

Create bucket before upload javascript
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.

Framework-Specific Fixes

supabase-js

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 })
}

You Might Also Like

Frequently Asked Questions

Why am I seeing Supabase error NoSuchBucket?

Most often this happens when uploading to a bucket id that was never created, or when bucket deleted while objects still referenced.

How do I fix Supabase error NoSuchBucket?

Create the bucket first with supabase.storage.createBucket('name').

Which frameworks have documented fixes for error NoSuchBucket?

This page documents fixes for: supabase-js.

Official Sources

This page is based on the official Supabase documentation linked below and adds practical troubleshooting guidance on top.