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?
No description
8 Replies
EnderTheNetrunner
EnderTheNetrunner•3mo ago
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!
EnderTheNetrunner
EnderTheNetrunner•3mo ago
Looks like I'm getting a Callback Failed status. Hmmmm . . .
No description
EnderTheNetrunner
EnderTheNetrunner•3mo ago
. . . 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.
No description
EnderTheNetrunner
EnderTheNetrunner•3mo ago
Okay, yeah, this confirms the theory. Now I need to figure out how to configure ngrok for this, one sec.'
No description
EnderTheNetrunner
EnderTheNetrunner•3mo ago
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.
No description
No description
EnderTheNetrunner
EnderTheNetrunner•3mo ago
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.
james
jamesOP•3mo ago
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
EnderTheNetrunner
EnderTheNetrunner•3mo ago
Hmmm That one I haven't dug into

Did you find this page helpful?