Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage .list() method not seem to be working #111

Open
thesyedbasim opened this issue Sep 24, 2022 · 1 comment
Open

Storage .list() method not seem to be working #111

thesyedbasim opened this issue Sep 24, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@thesyedbasim
Copy link

Bug report

Describe the bug

The .list() method in supabase.storage.from('') is not seem to be working.

  • I have data in my storage bucket
  • There is no error shown, only empty data
  • Storage bucket has no RLS
  • The path is correct, I even tried the root path but it's still not working

To Reproduce

You can copy this snippet and add it to your code which is connected to supabase.

const { data, error } = await supabase.storage
	.from('images')
	.list(`products/${productId}`);

if (error) {
	console.error(error);
}

Expected behavior

List of all images should be returned.

System information

  • OS: Windows 10
  • Browser: Chrome
  • Version of supabase-js: 1.29.4
  • Version of Node.js: 16.13.1
@thesyedbasim thesyedbasim added the bug Something isn't working label Sep 24, 2022
@soedirgo soedirgo transferred this issue from supabase/supabase-js Sep 26, 2022
@inian
Copy link
Member

inian commented Sep 26, 2022

Hey @thesyedbasim, by default storage buckets are private and have RLS turned on. If you want to list objects from the bucket, the user must have the appropriate read policy attached or use the service role key to completely bypass access control for the bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants