© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
1 reply
lucksp

remove() doesn't seem to remove the file from a bucket

I am running a script to delete files:

await supabase.storage
  .from('myBucket')
  .remove([`myBucket/${duplicateFile.name}`]); // includes bucket in pathname
await supabase.storage
  .from('myBucket')
  .remove([`myBucket/${duplicateFile.name}`]); // includes bucket in pathname

however, the file remains after. Things I have checked:

- Policy: Only users who are authenticated & exist in a specific table of users is allowed:

Policies under storage.buckets
DELETE
Enable delete for ADMIN users

((auth.role() = 'authenticated'::text) AND (EXISTS ( SELECT 1
   FROM admin_users
  WHERE (admin_users."userId" = auth.uid()))))
((auth.role() = 'authenticated'::text) AND (EXISTS ( SELECT 1
   FROM admin_users
  WHERE (admin_users."userId" = auth.uid()))))


- Checked My bucket settings:
[
  {
    "id": "myBucket",
    "name": "myBucket",
    "owner": null,
    "created_at": "2024-01-25 15:08:19.641355+00",
    "updated_at": "2024-01-25 15:08:19.641355+00",
    "public": false,
    "avif_autodetection": false,
    "file_size_limit": null,
    "allowed_mime_types": null,
    "owner_id": null
  }
]
[
  {
    "id": "myBucket",
    "name": "myBucket",
    "owner": null,
    "created_at": "2024-01-25 15:08:19.641355+00",
    "updated_at": "2024-01-25 15:08:19.641355+00",
    "public": false,
    "avif_autodetection": false,
    "file_size_limit": null,
    "allowed_mime_types": null,
    "owner_id": null
  }
]

- Errors: none exist.

Any other ideas?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

signOut doesn't remove session from local storage
SupabaseSSupabase / help-and-questions
4y ago
Unable to upload file to a storage bucket.
SupabaseSSupabase / help-and-questions
4y ago
Upload file to bucket with metadata from client side
SupabaseSSupabase / help-and-questions
5mo ago
Supabase crashed after uploading a file to bucket
SupabaseSSupabase / help-and-questions
4y ago