imageUploader
An error occured when running the middleware for the imageUploader route
The error above is from uploadthing using in imageTool in Editor/js
Image Tool: uploading failed because of Error: An error occured when running the middleware for the imageUploader route at UploadThingError.fromResponse (webpack-internal:///(app-pages-browser)/./node_modules/@uploadthing/shared/dist/index.mjs:224:12) at async eval (webpack-internal:///(app-pages-browser)/./node_modules/uploadthing/dist/client.mjs:50:21) at async DANGEROUS__uploadFiles (webpack-internal:///(app-pages-browser)/./node_modules/uploadthing/dist/client.mjs:36:27) at async Object.uploadByFile (webpack-internal:///(app-pages-browser)/./src/components/Editor.tsx:115:49)
this is my image tool config in Editor js
image: {
class: ImageTool,
config: {
uploader: {
async uploadByFile(file: File) {
console.log("uploading");
// upload to uploadthing
const res = await uploadFiles({
files: [file],
endpoint: "imageUploader",
});
return {
success: 1,
file: { url: res[0].fileUrl },
};
},
},
},
},
please help me with that it really hurts!
uploadByFile is a key with your function as its value.
try this:
image: {
...
uploader: {
uploadByFile: async (file: File) => {...}
}
...
}
@xanderjakeq thanks mate! it worked.