onUploadComplete callback fails

Hey All, Setting up uploadthing in a fresh next app router app. Running next dev server using bun run dev. onUploadComplete does not seem to fire at all. In UT dash im seeing "callback failed" and can't seem to find too much in the logs: system sent a callback for an uploaded file { "url": "http://localhost:3000/api/uploadthing?slug=geoDataUploader", "type": "callback", "status": -1, "request_id": "RID" } Even just copying out the example docs 1:1 of the imageUploader router etc, no go. What could cause this?
5 Replies
zezima
zezimaOP3w ago
Also, my routes are served from default location (http://localhost:3000/api/uploadthing) Everything matches getting started template
Thomas
Thomas2w ago
I think I have the same issue. Were you able to solve it? I just fount it! Add this to the route handler in route.ts config: { isDev: env.NODE_ENV === "development" },
Fefe_du_973
Fefe_du_9737d ago
hey ! what should NODE_ENV supposed to be please ?
Mukul Anand
Mukul Anand5d ago
I have the same issue... I want to save the file in database after the upload using onUploadComplete but its not working...
james162861
james1628614d ago
this solved it for me in /uploadthing/route.ts export const { GET, POST } = createRouteHandler({ router: ourFileRouter, config: { isDev: env.NODE_ENV === "development" }, }); I thin kthis is a bug

Did you find this page helpful?