Supabase getBucket function is giving a 404 error

66 Views Asked by At

I am trying to follow supabase's documentation at "https://supabase.com/docs/reference/javascript/storage-getbucket" to retrieve bucket details. When I write the following code, I get a 404 error;

  const { data, error } = await supabase
  .storage
  .getBucket('product-images')
  console.log(data, error)

Data returns null and error returns 404 bucket is not found. Bucket is public and have permissions. Not sure what else to check?

1

There are 1 best solutions below

0
On

Make sure the user calling getBucket has the permission to access the bucket.

https://supabase.com/docs/guides/storage/security/access-control