Closed marienjus closed 1 month ago
Utapi is server-only
You can use it in server actions but you cant just export the class like you're doing.
Make a server action and call the function in there
In your actions file, do this:
// actions.ts
"use server";
import { UTApi } from "uploadthing/server";
const utapi = new UTApi();
export const listFiles = utapi.listFiles;
and import that instead. actions must be async functions, you cannot export an object/class instance
I understand that this issue may be closed if it should be filed in another category
My issue
I dont seem to get why this is coming out. my code:
// actions: