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
Also, my routes are served from default location (http://localhost:3000/api/uploadthing)
Everything matches getting started template
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" },
hey ! what should NODE_ENV supposed to be please ?
I have the same issue...
I want to save the file in database after the upload using onUploadComplete but its not working...
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