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

react生成图片时跨域:18323:1 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. #381

Open
chenq77 opened this issue Apr 22, 2023 · 2 comments

Comments

@chenq77
Copy link

chenq77 commented Apr 22, 2023

  • 你当前是什么框架(必填):react
  • 你使用的是哪个包(必填):@lucky-canvas/react
  • 你当前插件的版本(必填):"@lucky-canvas/react": "^0.1.13",
  • 详细描述你的bug:使用dom-to-image生成图片时报错,经排查,发现一旦带图片就会报错;查了下解决方法

image
需要在绘制图片时加上

img.crossOrigin = 'Anonymous';  // 加在src = ... 后

不知道怎么修改源码,望作者大大能提供帮助

@buuing
Copy link
Owner

buuing commented May 16, 2023

哦哦, 这个属性需要我在代码里加

@lyting97
Copy link

哦哦, 这个属性需要我在代码里加

作者大大你好,这个属性是否有空添加呢,在2024.7.15再次遇到同样的问题

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

No branches or pull requests

3 participants