Cannot catch or log error, onUploadError

const { startUpload } = useUploadThing('imageUploader',{
onUploadError(e) {
console.log(e)
},
})

...

if (files.length > 0) {
const uploadedImages = await startUpload(files)
.catch((error) => {
console.log(error);

handleMessageToast({type:'destructive',title:'Erro',message:'Error'})

})

if (!uploadedImages) {
return
}

uploadedImageUrl = uploadedImages[0].url
}
const { startUpload } = useUploadThing('imageUploader',{
onUploadError(e) {
console.log(e)
},
})

...

if (files.length > 0) {
const uploadedImages = await startUpload(files)
.catch((error) => {
console.log(error);

handleMessageToast({type:'destructive',title:'Erro',message:'Error'})

})

if (!uploadedImages) {
return
}

uploadedImageUrl = uploadedImages[0].url
}
The console.logs or the Toast not working
No description
2 Replies
peterkyle01
peterkyle017mo ago
You are trying to upload a bigger file of 11mb that surpasses the maximum size allowed of around 4mb.Try disconnecting from the Internet with the right image size and see if you get the toasts or logs
botabota
botabotaOP7mo ago
I did not get the Toast with your aproach neither the logs
Want results from more Discord servers?
Add your server