sudhanshug
Explore posts from serversTTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
you should probably post a new question because this thread is mostly about v7.
132 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
but not ideal 🙂
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
good for me, they are our contractors and I can direct them to the web app
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
can you cut me an adhoc build lol, my users are kinda stuck 🙃
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
maybe it's of use to you lol, maybe not
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
i wrote this a few days ago to do direct uploads to s3 via activestorage
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
Can you try jsdebugger’s network tab and see if your upload request resolves. I only see a HEAD request
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
🙌
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
Okay so I did some digging and here is what's happening:
1. My /api/uploadthing api resolves with the correct presigned url
2. UT sdk makes a HEAD request to the signed URL which succeeds (which is 0B in size)
3. SDK errors out with the error I shared earlier ("UPLOAD_FAILED"). It never sends the PUT/POST request with the actual file.
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
That was a false alarm, I did not setup port forwarding correctly on my device - the host wasn't found hence no requests.
But now I am getting the error "UPLOAD_FAILED" (code and message is the same) with undefined err.cause. The upload action to my /api/uploadthing API resolves to a 200 response so I am assuming it is failing to upload to the signed URL.
(trying to confirm this assumption)
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
The SDK does not even call my /api/uploadthing endpoint. However, the same setup works fine on the web export of the app
38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 11/4/2024 in #questions
[Expo + UT] Error when importing @uploadthing/expo
I was able to get it to not error out using a polyfill (
text-encoding-polyfill
). But then my uploads are failing with
This error may or may not be related38 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
132 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
I am on rails, there is no concept of file route.
you dont need to register the upload if you are not using any FileRouteok this is news, will try that
and you can generate signed url without extra requestI am aware of this but the crypto is not matching with what UT server expects and I gave up and used prepareUpload
132 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
Okay, I will give you a rundown since you are new on this thread. I am trying to do server uploads and here are the issues I am facing:
With v6 uploadFile, the file is uploaded correctly but it is not available immediately, my client receives an empty response when requesting the file (via an <img tag). This is fixed on immediately reloading my page, so I am assuming the lag is ~1sec.
With v7 prepareUpload, I will have to generate the signed url, register the upload, and then upload the file (3 calls). Since my use case is server uploads, I do not need a callback and hence want to avoid the upload registration entirely. If i dont register the upload, the PUT request never resolves and the file is stuck in uploading state.
Lmk if that makes sense 🙂
132 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
i tried that and it looks like the PUT request waits till the file-key is registered with UT
132 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
for my server uploads, i dont want a callback - can i pass nil to callback url and slug in the router-metadata request?
132 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] How to use UploadThing outside of JS ecosystem, using Rest API?
I suppose i need to register the upload using the route-metadata endpoint, right? Would've been nice if I didn't have to do that.
132 replies