svelte-quill
svelte-quill copied to clipboard
quill.register("modules/moduleName", ModuleName) does not work
When i try to register quill-image-uploader using the quill.register function I get the following error:
Unhandled Promise Rejection: TypeError: index_umd.quill.register is not a function. (In 'index_umd.quill.register("modules/imageUploader", ImageUploader)', 'index_umd.quill.register' is undefined)
I tried to register using the following: ` import ImageUploader from "quill-image-uploader"; quill.register("modules/imageUploader", ImageUploader);
imageUploader: { upload: file => { return new Promise((resolve, reject) => { console.log("Now"); const formData = new FormData(); formData.append("image", file);
fetch(`${$apiUrl}upload-image`, {
method: "POST",
body: formData
})
.then(response => response.json())
.then(result => {
console.log(result);
resolve(result.data.url);
})
.catch(error => {
reject("Upload failed");
console.error("Error:", error);
});
});
}
},
`