Open saiksaif opened 5 months ago
in uploadthing folder>core.ts have u used const response = await fetch(https://utfs.io/f/${file.key}
) this?
Do you mean this line:
const response = await fetch(https://uploadthing-prod.s3.us-west-2.amazonaws.com/${file.key}
)
I am using the project as it is and this line is what's similar the one you mention in the project.
That's why it's not working try using my line the code is old and uploaded longtime ago
I tried but that didn't change anything, still same error.
I had the same issue, file uploading didn't work when deployed. It was stuck at the upload box loading. Looking at the logs, the api/trpc/getFile endpoint was being polled every few seconds and never stopped (also error 404).
Afterward, I noticed the file was successfully uploaded to UploadThing but it was NOT added to the database (thus the infinite polling), so the issue was the code to add the file to the database wasn't running (the code in the callback onUploadComplete in src/app/api/uploadthing/core.ts).
Turns out Vercel was the issue, it allowed a maximum of a few seconds of computing at a time so the uploaded file was never added to the database as the code to do it timed out. Thus, the infinite polling.
TLDR; the solution is to deploy elsewhere like Netlify or upgrade from the Hobby plan on Vercel.
I had the same issue, file uploading didn't work when deployed. It was stuck at the upload box loading. Looking at the logs, the api/trpc/getFile endpoint was being polled every few seconds and never stopped (also error 404).
Afterward, I noticed the file was successfully uploaded to UploadThing but it was NOT added to the database (thus the infinite polling), so the issue was the code to add the file to the database wasn't running (the code in the callback onUploadComplete in src/app/api/uploadthing/core.ts).
Turns out Vercel was the issue, it allowed a maximum of a few seconds of computing at a time so the uploaded file was never added to the database as the code to do it timed out. Thus, the infinite polling.
TLDR; the solution is to deploy elsewhere like Netlify or upgrade from the Hobby plan on Vercel.
I have faced same issue and not fixing 😔
And when uploading 3 page of pdf still show error that so many page in pdf
did anyone fix it please iam not able to create chat after uploading the pdf it always shows file is too large
When I upload a pdf in the dashboard, I start getting a failed POST request which starts repeating infinitely:
POST http://localhost:3000/api/trpc/getFile?batch=1
In the network tab, this is what the request gives:
[ { "error": { "message": "NOT_FOUND", "code": -32004, "data": { "code": "NOT_FOUND", "httpStatus": 404, "stack": "TRPCError: NOT_FOUND\n at eval (webpack-internal:///(rsc)/./src/trpc/index.ts:175:26)\n at async resolveMiddleware (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/index.mjs:434:30)\n at async callRecursive (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/index.mjs:464:32)\n at async callRecursive (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/index.mjs:464:32)\n at async callRecursive (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/index.mjs:464:32)\n at async resolve (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/index.mjs:494:24)\n at async inputToProcedureCall (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/resolveHTTPResponse-2fc435bb.mjs:54:22)\n at async Promise.all (index 0)\n at async resolveHTTPResponse (webpack-internal:///(rsc)/./node_modules/@trpc/server/dist/resolveHTTPResponse-2fc435bb.mjs:190:37)", "path": "getFile" } } } ]
The project is same as it was cloned from the repo, I only added my env variables.
What could be causing this? I checked around for hours and can't figure it out, any help would be really appreciated.