onUploadComplete is not being called
hey! so after uploading an image on uploadthing, i want to store the link to the database through onUploadComplete but it seems to not be working, is there something im missing here?

8 Replies
What specific issue are you running into? Is the DB write not being processed, is there an error, what's going on?
Amendment, just realized the problem was in the title.
Amendment, I'm actually getting this, too. Code is essentially a copy-paste of the NextJS quickstart. Might be a bug!
Looks like I'm getting a Callback Failed status. Hmmmm . . .

. . . I think I found the culprit. If this is what I think it is, the system is trying to send a callback to your computer. As in, it's UploadThing's servers sending a callback HTTP request.

Okay, yeah, this confirms the theory. Now I need to figure out how to configure ngrok for this, one sec.'

Okay, so fun fact: I was able to get this to work, but I needed to configure Ngrok to use port 3000 and then access the application through the Ngrok URL in order for the callback to work.
Other fun fact, modifying the App URL inside of the UploadThing settings did nothing. Like, literally it did not affect whether the callback came through or not, the only thing that changed for me was whether I accessed my local dev server through the Ngrok URL or not. You can try it yourself and see if you get the same results.
First image is when I'm using the Ngrok URL, second one is localhost.


Update: No ngrok required, use
UPLOADTHING_IS_DEV=true
when running the server for now. Probably chuck it in your .env.local
so you don't forget.hi @EnderTheNetrunner ! thanks so much for the help i only saw your messages until now, really appreciate it! noobie dev here from high school 😅
i was struggling over this for over a day i had to do a post request on the client
btw, does using the utfs.io link work for you when using next/image?
it didnt work for me despite doing the said configurations on my next.config, i tried using another s3-like service and it works for theirs
Hmmm
That one I haven't dug into