Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom media library error #97

Open
radilaci opened this issue Nov 29, 2023 · 0 comments
Open

Custom media library error #97

radilaci opened this issue Nov 29, 2023 · 0 comments

Comments

@radilaci
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant