joschan21 / breadit

Modern Fullstack Reddit Clone in Next.js 13 & TypeScript
1.06k stars 262 forks source link

Might be error from UploadThing or Editorjs #15

Open Nith567 opened 1 year ago

Nith567 commented 1 year ago

When i am trying to upload an image or post a link, its comes up and says :"Couldn’t upload image. Please try another."(for an image)

Avijit-Sarkar commented 1 year ago

same problem started to happen

joschan21 commented 1 year ago

That's not good, might be something UploadThing or EditorJS have changed under the hood

SaiSawant1 commented 1 year ago

I have just finished the whole video and not getting the error you should reevaluate your code.

ryanyogan commented 1 year ago

Either downgrade upload-thing to version 4.x
npm install uploadthing@4.x

Or use the latest documentation as things changed in version 5.0.0

krsnamara commented 5 months ago

Yes I am getting this same issue. Will look into the documentation or downgrade as you have suggested

krsnamara commented 5 months ago

Looking at the error message I opened up an internal file and found that uploadthing is just S3 under the hood. Going to get back to it tomorrow and add either S3 or supabase as the image storage function and toss uploadthing.

Image Tool: uploading failed because of TypeError: Cannot read properties of undefined (reading 'map')
    at uploadFilesInternal (index.js:168:27)
    at eval (index.js:234:9)
    at Object.uploadByFile (Editor.tsx:72:50)
    at eval `(bundle.js:10:35524)
// Get presigned URL for S3 upload
    const s3ConnectionRes = await reportEventToUT("upload", {
        input: "input"in opts ? opts.input : null,
        files: opts.files.map((f)=>({
            name: f.name,
            size: f.size,
            type: f.type
        }))
    });