Closed magnusrodseth closed 1 year ago
Hello @magnusrodseth,
based on your description and since the error is raised from the supabase.storage.from(BUCKET_ID).upload(...)
i think that this is not related to the ClerkJS codebase and you probably need to open the ticket to Supabase.
I cannot think of a way that this issue could be fixed from the Clerk side since it's a DatabaseError in Supabase for storing files. If the Supabase team identifies something related to our codebase, please re-open this ticket and let me know how i can help you.
I have a Next.js application using Supabase for data and file storage, and Clerk for user storage and authentication. Because users are stored with an ID like
user_abcdefghijkl
, and not a UUId like123e4567-e89b-12d3-a456-426614174000
, I get the following error when trying to upload a file to Supabase:This is the error that I
console.log
when calling the following:All other data can be successfully written to and read from the database.
It seems to me like the call to
.upload(...)
implicitly checks the user ID of the currently logged-in user, and throws because the user ID is not a UUID.Note that the
userId
is stored asTEXT
in the database, due to the way Clerk generated IDs.Currently, during development, I allow all users to select, insert, update and delete. Hence, I don't think the error stems from a policy that's too restrictive.
How can I solve this issue and allow users to upload files?