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

Fix Image Lazy Loading Preventing Image Export #485

Open
vicksiyi opened this issue Feb 27, 2025 · 1 comment
Open

Fix Image Lazy Loading Preventing Image Export #485

vicksiyi opened this issue Feb 27, 2025 · 1 comment

Comments

@vicksiyi
Copy link

vicksiyi commented Feb 27, 2025

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

The current implementation of lazy loading for images causes issues when exporting content, as the images are not fully loaded and therefore not included in the export. This PR addresses the problem by ensuring that all images are fully loaded before the export process begins.

Here is the diff that solved my problem:

diff --git a/node_modules/dom-to-image/src/dom-to-image.js b/node_modules/dom-to-image/src/dom-to-image.js
index 27201ac..886298c 100644
--- a/node_modules/dom-to-image/src/dom-to-image.js
+++ b/node_modules/dom-to-image/src/dom-to-image.js
@@ -727,6 +727,7 @@
                             element.onload = resolve;
                             element.onerror = reject;
                             element.src = dataUrl;
+                            element.loading = '';
                         });
                     });
             }

This issue body was partially generated by patch-package.

@forever0714yuan
Copy link

forever0714yuan commented Feb 27, 2025 via email

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

2 participants