Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOMException: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

Tags:

html2canvas

Encountered when using html2canvas: DOMException: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

 html2canvas(document.getElementById('qr-code-content'), {useCORS: true}).then(canvas => {
        document.getElementById('qr-code-content').append(canvas);
        this.base64ImgData = canvas.toDataURL();
        this.sharing = true;
      });
like image 591
hudaxin Avatar asked Aug 29 '19 01:08

hudaxin


1 Answers

This PR address the issue. https://github.com/niklasvh/html2canvas/pull/2020

You can use the fork if you need a quick solution or wait until it gets merged and get it from the main repo.

like image 189
Zahema Avatar answered Oct 20 '22 11:10

Zahema