Image Tool: uploading failed because of incorrect response: {}
h0lme3 opened this issue · 2 comments
h0lme3 commented
Hello, everybody.
I am using Next.js and editorjs to upload file(image).
editor_ = await new EditorJS({
...
image: {
class: ImageTool,
config: {
uploader: {
uploadByFile(file: File) {
const formData = new FormData();
formData.append("projectPubKey", projectPubKey);
formData.append("image", file);
return new Promise((resolve, reject) => {
fetch("/api/editor/init", {
method: "POST",
body: formData,
})
.then((res) => {
console.log(res, "res");
resolve(res);
})
.catch((error) => reject(error));
});
},
},
},
},
...
})
How can I figure it out? Any help? Thanks in advance!
h0lme3 commented
It was issue on my end. Solved it.
Esmin53 commented
How did you fix this?