supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

storage functions not working when upgrading to NextJS 13.4, 13.5 or 14

Open gascenciom1998 opened this issue 1 year ago • 1 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When upgrading to NextJS 13.4, 13.5 or 14, from version 13.2.4, occassionally, storage functions like list and update will not work. list will return no data even though the file being searched exists, and update with not perform an update on an existing file

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Upgrade NextJS to Next14
  2. Run code like the following:
const files = await supabase.storage.from(BUCKET).list('', {
    search: 'searchTerm',
})

Ocassionally (not always, very weird) files will be empty even though I am sure a file exists with the 'searchTerm' in my BUCKET in the root path

Also running code like

supabase.storage.from(BUCKET).update(data)

will not actually perform an update.

I made no changes to this code in my codebase, I just upgraded to NextJS 14

Expected behavior

I would expect list to return something for a file that exists, and update to actually perform an update on the file that exists

Screenshots

N/A

System information

  • OS: macOS
  • Browser (chrome
  • Version of supabase-js: Tried with 2.15.0 and with 2.38.4
  • Version of Node.js: 18

Additional context

This only happens when I upgrade to NextJS 14 from NextJS 13. Also not sure but possible related to this other issue: https://github.com/supabase/supabase-js/issues/898

gascenciom1998 avatar Nov 12 '23 18:11 gascenciom1998

Not sure but could this PR in the storage-api fix it? https://github.com/supabase/storage-api/pull/394

gascenciom1998 avatar Nov 12 '23 21:11 gascenciom1998