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}`);
....


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
Was this page helpful?