unlayer / react-email-editor

Drag-n-Drop Email Editor Component for React.js
https://unlayer.com/embed
MIT License
4.51k stars 728 forks source link

ImageMaxSizeExceededError when uploading an image #403

Open arndvs opened 3 months ago

arndvs commented 3 months ago

I am currently using the react-email-editor 1.7.10 component in my React Next.JS application, and I have encountered an issue when trying to upload an image.

When attempting to insert an image, I receive an error at the "Almost there - Uploading your image..." stage. The error message is as follows:

at https://editor.unlayer.com/1.9.2/editor.js:2:901383
at p (https://editor.unlayer.com/1.9.2/editor.js:2:887565)
at Generator.<anonymous> (https://editor.unlayer.com/1.9.2/editor.js:2:888892)
at Generator.next (https://editor.unlayer.com/1.9.2/editor.js:2:887975)
at w (https://editor.unlayer.com/1.9.2/editor.js:2:893476)
at a (https://editor.unlayer.com/1.9.2/editor.js:2:893679)

I noticed that there was a recent update to the Unlayer editor, version 1.9.1, released 7 days ago by John Edward.

The release notes mention that this update includes a fix for the use of the image editor. I am wondering if this update might be related to the issue I am facing and if it could potentially address the ImageMaxSizeExceededError.

Could you please provide guidance on how to resolve this error and successfully upload images within the react-email-editor component? Are there any specific configuration options or properties I should be aware of to handle image size limits correctly?

Any assistance or insights you can provide would be greatly appreciated. If you need any further information or clarification, please let me know.

Thank you,

Aaron

brunolemos commented 3 months ago

Hello, what's the size of the image in megabytes?

HolyWalley commented 3 months ago

Hey We have similar issue (1.7.9) but with the new Magic Images by AI feature. I just pick one of the suggested prompts A photo of a Samoyed dog with its tongue out hugging a white Siamese cat, Surrealism style and surrealism style and then pick first image suggested. And I'm getting this in console

ImageMaxSizeExceededError: Max size exceeded
    at editor.js:2:898992
    at p (editor.js:2:887565)
    at Generator.<anonymous> (editor.js:2:888892)
    at Generator.next (editor.js:2:887975)
    at w (editor.js:2:893476)
    at a (editor.js:2:893679)
image

Chrome says that image that I picked is 3.2MB We also have 2MB limit on our side, but seems like this validation comes from unlayer.

Any suggestions?

P.S. It looks like this error only happens in our dev environment 🧐 P.S.S. It looks like our dev env domain (localhost) is not added to the allowed domains in unlayers admin. I checked on other our staging and I've got the same error there. So, I assume, in dev we don't use premium and that what causes the issue.