UploadThing + Next.js (App Router) + Kinde Auth middleware → Failed to parse response (InvalidJson)

Hi everyone šŸ‘‹, I’m using Next.js (App Router) with TypeScript, Prisma, and Kinde Auth middleware, and I keep hitting this error when trying to upload an image with UploadThing: UploadThingError: Failed to parse response from UploadThing server Caused by: InvalidJson My setup: middleware.ts uses withAuth from @kinde-oss/kinde-auth-nextjs. I already excluded /api/uploadthing in both publicPaths and matcher. My next.config.ts has utfs.io under images.domains. In app/api/uploadthing/route.ts, I’m using createNextRouteHandler with runtime = "nodejs". But the UploadThing server still fails with the same error.
4 Replies
julius
julius•5d ago
only thing i can think of here is that you're getting a 404/401 next.js page with html content that fails to json parse
Khader A_
Khader A_OP•4d ago
let me explain my issue
Khader A_
Khader A_OP•4d ago
i am using nextjs with ts also uploadthing to upload image once i upload image it show error like images below how can i fix it?
No description
No description
Khader A_
Khader A_OP•4d ago
currently i have upgraded latest version of uploadthing so error was gone thanks a lot @julius

Did you find this page helpful?