vue-email-editor icon indicating copy to clipboard operation
vue-email-editor copied to clipboard

Custom media library error

Open radilaci opened this issue 2 years ago • 0 comments

Hi,

I am trying to implement a custom media library for image selection.

this.$refs.emailEditor.editor.registerCallback('selectImage', function (data, done) {
    // Open modal, select image...
});

When I register the selectImage callback, an error immediately raised:

Error: Invalid result passed to selectImage callback. Expected object with url, width, height and size. Received: undefined
    at editor.js:2:779311
    at p (editor.js:2:770888)
    at Generator.<anonymous> (editor.js:2:772215)
    at Generator.next (editor.js:2:771298)
    at w (editor.js:2:776799)
    at a (editor.js:2:777002)
    at editor.js:2:777061
    at new Promise (<anonymous>)
    at editor.js:2:776942
    at editor.js:2:780880

This can be seen in the example page, too: https://examples.unlayer.com/media/custom-media-library/

Just add an image to the editor, and click on the Upload image button. The error is also visible behind the modal, under the button.

Any ideas?

radilaci avatar Nov 29 '23 10:11 radilaci