UploadThing Callback Failing on Localhost with useUploadThing Hook

I'm experiencing an issue where UploadThing successfully uploads images, but the callback to my local application fails. As a result, uploaded images are not being reflected in my application's UI. The callback error indicates a transport issue when attempting to POST to http://localhost:3000/api/uploadthing.

Error Logs:

✓ Compiled /api/uploadthing in 1068ms (3228 modules)
POST /api/uploadthing?actionType=upload&slug=productUploader 200 in 1175ms
ERROR (#42) handleJsonLineStream=2033ms handleUploadAction=2064ms: Failed to forward callback request from dev stream
  signature: hmac-sha256=40a14c33081b1e4975a1dc6000812132343411241341409966217ac8f85d2284b351d
  hook: callback
  payload: {"status":"uploaded","metadata":{},"file":{"url":"https://utfs.io/f/BSckEMHO6XG2adfasdfasfasdfafdafdafas4","appUrl":"https://utfs.io/a/valy6o7o4x/BScadfasfafasdfXG23OekOJasdfafasfsafG9Ilotg865bzk4","name":"fwfwff33f.png","key":"BSckEMHO6XG23OekOJzETPZOjfUwcvhVyLG9Ilotg865bzk4","size":2493007,"type":"image/png","customId":null,"fileHash":"f9460ef834258c9be42a7675124523522304b"}}
  error: RequestError: Transport error (POST http://localhost:3000/api/uploadthing)
    at fetch failed: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer



Environment:

UploadThing Version: @uploadthing/react@^7.0.3
Node Version: 20.16
Framework: Next.js
Was this page helpful?