© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
15 replies
besteman

Can not retrieve from Storage on Localhost

Hello,

I am using an edge function to grab data that is inside of Storage. In Prod, everything is working as expected, but on localhost, it is not.

serve(async (req) => {
  const supabaseClient = createClient(
    Deno.env.get('SUPABASE_URL') ?? '',
    Deno.env.get('SUPABASE_ANON_KEY') ?? '',
    {
      global: {headers: {Authorization: req.headers.get('Authorization')!}},
      auth: { persistSession: false },
    }
  );

  const { data: folderData, error: _foldersError } = await supabaseClient
    .storage
      .from('raw_inventory_data')
      .list('', {
        limit: 100,
        offset: 0,
      });

  console.log(`The folder data is ${folderData}`);
  console.log(`The folder error is ${_foldersError}`);
....
serve(async (req) => {
  const supabaseClient = createClient(
    Deno.env.get('SUPABASE_URL') ?? '',
    Deno.env.get('SUPABASE_ANON_KEY') ?? '',
    {
      global: {headers: {Authorization: req.headers.get('Authorization')!}},
      auth: { persistSession: false },
    }
  );

  const { data: folderData, error: _foldersError } = await supabaseClient
    .storage
      .from('raw_inventory_data')
      .list('', {
        limit: 100,
        offset: 0,
      });

  console.log(`The folder data is ${folderData}`);
  console.log(`The folder error is ${_foldersError}`);
....


here is a snippet of the code in question. I have created the raw_inventory_data locally in the studio, but every time I run it the folder data is empty.

I am trying to get it working locally, so I can code quicker. Any help would be appreciated!

Thank you!
Image_2023-12-08_at_12.11.20_PM.jpg
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

Storage transform API in localhost not working
SupabaseSSupabase / help-and-questions
13mo ago
Failed to retrieve project's storage configuration
SupabaseSSupabase / help-and-questions
4mo ago
login works on localhost but not on netlify
SupabaseSSupabase / help-and-questions
4y ago
auth works on localhost but not on netlify
SupabaseSSupabase / help-and-questions
4y ago