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.
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.
