Christian Carpinelli
Christian Carpinelli
TTCTheo's Typesafe Cult
Created by Christian Carpinelli on 9/19/2024 in #questions
ERROR handleCallbackRequest Failed to register callback result
I've integrated UploadThing in my platform. The client is a NextJS application and the server is a cluster of NestJS microservices. The issue is that after a successful file upload (on UploadThing the file is present), the onUploadComplete callback is not executed, thus not finishing the upload correctly on the client, because I'm getting:
00:40:26.611 DEBUG handleCallbackRequest 'onUploadComplete' callback finished. Sending response to UploadThing:
ᐉ { "callbackData": {"fileKey":"Yp1sykmpbCf4flJwaXR7axB1jFwdyoRIVZnUlCELh5Xtc9Mm","callbackData":"https://utfs.io/f/Yp1sykmpbCf4flJwaXR7axB1jFwdyoRIVZnUlCELh5Xtc9Mm"} }
00:40:26.620 INFO handleUploadAction -> handleJsonLineStream Successfully simulated 'callback' event
00:40:26.819 ERROR handleCallbackRequest Failed to register callback result (400)
ᐉ { "error": {"error":"Invalid request body","details":[{"code":"invalid_type","expected":"object","received":"string","path":["callbackData"],"message":"Expected object, received string"}]} }
00:40:26.820 DEBUG handleCallbackRequest ResponseError: StatusCode: non 2xx status code (400 POST https://sea1.ingest.uploadthing.com/callback-result)
00:40:26.611 DEBUG handleCallbackRequest 'onUploadComplete' callback finished. Sending response to UploadThing:
ᐉ { "callbackData": {"fileKey":"Yp1sykmpbCf4flJwaXR7axB1jFwdyoRIVZnUlCELh5Xtc9Mm","callbackData":"https://utfs.io/f/Yp1sykmpbCf4flJwaXR7axB1jFwdyoRIVZnUlCELh5Xtc9Mm"} }
00:40:26.620 INFO handleUploadAction -> handleJsonLineStream Successfully simulated 'callback' event
00:40:26.819 ERROR handleCallbackRequest Failed to register callback result (400)
ᐉ { "error": {"error":"Invalid request body","details":[{"code":"invalid_type","expected":"object","received":"string","path":["callbackData"],"message":"Expected object, received string"}]} }
00:40:26.820 DEBUG handleCallbackRequest ResponseError: StatusCode: non 2xx status code (400 POST https://sea1.ingest.uploadthing.com/callback-result)
Since I'm developing, I've made sure to have the isDev flag to true. Implementing UploadThing has been almost effortless and I really like it, but there's this error that I can't understand, maybe I'm dumb and forgot something... PLS help, I'm cooked.
6 replies