Skip to content

Conversation

@lkwavestian
Copy link

Mainly for fix #42 .

When I upload my own svg icon and click download button,the button remains in the loading state and the download fails with an error

clickBefore

image

This error is mainly because dom-to-image cannot handle when dom contains svg img, here is the detail dom-to-image/issues/266.

dom-to-image-more can solve the problem.

But when I use dom-to-image-more, the downloaded image has a border:

de3b24423e8d52e46bf1797dba902582

I’m not completely certain about the original intention behind adding a border to the CoverImage. However, to ensure the stability of the existing logic, I decided to use a trick: add the class name to the DOM before generating the image, and remove it after generating the image.

The main code is element.classList.add("export-mode") and element.classList.remove("export-mode")

Try again

clickAfter

Success!

@vercel
Copy link

vercel bot commented Jul 30, 2025

@lkwavestian is attempting to deploy a commit to the Rutik Wankhade's projects Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

[BUG] The download failed after uploading an SVG icon

1 participant