UploadThing is not working on a production

Hello, I have an app in Typescript and NextJS 14. UploadThing is working correctly on dev, but when I build my app and start it it is not working. I'm not really sure why. When I upload an image on dev, it sends a fetch and the response is data as url and etc. But when I do the same on production, I never receive a response and the fetch fails in like 1 minute... BUT the image is uploaded... Next.js 14.0.1 uploadthing: 6.0.1 What should I do, thanks!
62 Replies
markr
markr7mo ago
Are you trying to run a built version locally? If so it won’t work because there is no way for the UT infra to send a webhook back to your local machine.
DanielHigh
DanielHigh7mo ago
I've tried on vercel and locally as well. Either one is not working. I had to change uploadthing to google drive because of it. Not really sure whats going on imo its because of new versions of next / uploadthing. I've used uploadthing in a past and never had this problem...
julius
julius7mo ago
can you reproduce this? I'm not quite sure I follow what the issue might be if it's not working on vercel either usually when people report this behavior it's cause they use a built version ( whcih doesn't have our dev webhook) on localhost (which can't be hit by a "normal" webhook) so therefore the callback isn't run - but if it's not working on vercel that's not the case
%ketyov
%ketyov7mo ago
i've got the same problem as well, using "uploadthing": "^6.0.1" and "next": "^14.0.0"
markr
markr7mo ago
Do you have a working repro?
%ketyov
%ketyov7mo ago
downgrading to "uploadthing": "^5.7.4" "@uploadthing/react": "^5.7.0", helped
%ketyov
%ketyov7mo ago
GitHub
GitHub - teceer/wlotki-online
Contribute to teceer/wlotki-online development by creating an account on GitHub.
%ketyov
%ketyov7mo ago
open for feedback 🏄‍♂️
%ketyov
%ketyov7mo ago
wlotki.online
System biletowy dla wydarzeń
markr
markr7mo ago
Upload seems to work fine?
No description
markr
markr7mo ago
Oh I see... it was broken for you in 6.0.1
%ketyov
%ketyov7mo ago
gonna deploy the not working version
%ketyov
%ketyov7mo ago
rollbacked, You can check https://wlotki.online now
wlotki.online
System biletowy dla wydarzeń
markr
markr7mo ago
got it ty. Current working theory is a race condition where ee.emit() is called before the listener is setup. we're on it
%ketyov
%ketyov7mo ago
great! thanks for quick action
markr
markr7mo ago
@uploadthing/react@6.0.1-canary.3fe3f69
uploadthing@6.0.2-canary.3fe3f69
@uploadthing/react@6.0.1-canary.3fe3f69
uploadthing@6.0.2-canary.3fe3f69
Give this a shot?
%ketyov
%ketyov7mo ago
the same error here
%ketyov
%ketyov7mo ago
GitHub
GitHub - teceer/wlotki-online at development
Contribute to teceer/wlotki-online development by creating an account on GitHub.
%ketyov
%ketyov7mo ago
No description
markr
markr7mo ago
got it, thank you
AKI
AKI7mo ago
Im also getting this error on production
AKI
AKI7mo ago
Works fine in development NextJS 13 UT Version 6.0.1 Getting error message in production but still uploads the file to UploadThing server and updates my planetscale values,
No description
AKI
AKI7mo ago
Happens when changing my cover photo in Profile Page Here is repo https://github.com/AlexisKenAlvarez/gchat
GitHub
GitHub - AlexisKenAlvarez/gchat
Contribute to AlexisKenAlvarez/gchat development by creating an account on GitHub.
markr
markr7mo ago
Downgrade to "uploadthing": "^5.7.4" "@uploadthing/react": "^5.7.0", for now. We are working on a fix. OK, new release is out. Should hopefully resolve this issue.
markr
markr7mo ago
GitHub
Releases · pingdotgg/uploadthing
File uploads for modern web devs. Contribute to pingdotgg/uploadthing development by creating an account on GitHub.
markr
markr7mo ago
hmm...
%ketyov
%ketyov7mo ago
recursively getting {"status":"still waiting"} in the response from https://uploadthing.com/api/serverCallback
markr
markr7mo ago
cc @julius
%ketyov
%ketyov7mo ago
the file has been transferred despite the lack of response
markr
markr7mo ago
I think I may have found the bug I'll have a canary in a minute or two for you
%ketyov
%ketyov7mo ago
ok, ready to test
markr
markr7mo ago
"@uploadthing/react": "6.0.2-canary.743cb77",
"uploadthing": "6.0.3-canary.743cb77"
"@uploadthing/react": "6.0.2-canary.743cb77",
"uploadthing": "6.0.3-canary.743cb77"
actually that probably wont fix it. Still give it a try though
markr
markr7mo ago
doing a bit more digging Did you revert to 5.7.4?
%ketyov
%ketyov7mo ago
"@uploadthing/react": "6.0.2-canary.743cb77", "uploadthing": "6.0.3-canary.743cb77", this version is currently on https://wlotki.vercel.app?_vercel_share=zFXRfEOYWxiRjV0ePlEYkAaGsfgJMhYw didn't change anything since last time I had a browser tab open in the background, and after some long time some request actually came through, cause i saw the image loaded when closing the tab
markr
markr7mo ago
Hmm, it seems like your onUploadComplete is failing for some reason, because our infra is never getting the message that lets it know that the callback completed
%ketyov
%ketyov7mo ago
ok, will check it
markr
markr7mo ago
Can I have an actual preview build link, since I think these ones are doing something weird with the ?_vercel_share query param Our callbacks might go to the wrong place
%ketyov
%ketyov7mo ago
Does this work for You? Do You have an access since this is a preview deployment? https://wlotki.vercel.app/
markr
markr7mo ago
Is that not the prod build?
%ketyov
%ketyov7mo ago
actually pushed to production on https://wlotki.online too
wlotki.online
System biletowy dla wydarzeń
markr
markr7mo ago
The link works, but usually I would expect a longer url like https://<repo>-<branch>-<org name>.vercel.app/
markr
markr7mo ago
No description
markr
markr7mo ago
This one seems to work with uploads https://wlotki.vercel.app is failing like you describe Ah yeah, this one I would need auth for
%ketyov
%ketyov7mo ago
strange, the https://wlotki-online-git-development-teceer-s-team.vercel.app/ is failing for mee to, but its connected to the same deployment as https://wlotki.online
wlotki.online
System biletowy dla wydarzeń
wlotki.online
System biletowy dla wydarzeń
%ketyov
%ketyov7mo ago
No description
markr
markr7mo ago
Huh... that is very weird. So the acutal prod deploy on the real domain works correctly. but preview builds are not
%ketyov
%ketyov7mo ago
first and second domains work, the third one is failing despite all being on the prod i will build it locally too
julius
julius7mo ago
Because thst last link is protected so our callback will be rejected
%ketyov
%ketyov7mo ago
makes sense
julius
julius7mo ago
I cant visit this So any request to it would be rejected also
%ketyov
%ketyov7mo ago
checked it locally, still the same problem
markr
markr7mo ago
remember for local builds you will need to use ngrok so that the callbacks can get back to your machine
%ketyov
%ketyov7mo ago
oh, didn't know about that
markr
markr7mo ago
You'll need to set VERCEL_URL env var to your ngrok tunnel
%ketyov
%ketyov7mo ago
thanks a lot, i will check on that
markr
markr7mo ago
and add the url config to the generateComponents and generateReactHelpers
%ketyov
%ketyov7mo ago
seems to be resolved for me
markr
markr7mo ago
https://docs.uploadthing.com/api-reference/react#configuration-2 nice! Glad we were able to get this sorted out
AKI
AKI7mo ago
Thankyou! This also resolved mine
Want results from more Discord servers?
Add your server
More Posts