tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

getting error when generating image on moblie #433

Open supremeliuao opened 1 year ago

supremeliuao commented 1 year ago

code:

domtoimage.toBlob((this.$refs.eoPosterContent as HTMLBaseElement))
      .then((blob: Blob) => {
        this.isDownloading = false;
        this.downloadTxt = 'downloading image';
        const link = document.createElement('a');
        link.download = `${ this.reportInfo.title }-${ Date.now().toString(16) }.png`;
        link.href = URL.createObjectURL(blob);
        link.click();
        URL.revokeObjectURL(link.href);
      }).catch((err) => {
        console.log(err);
        this.isDownloading = false;
        (this as any).$notify({
          message : 'image error',
          type : 'error'
        });
      })

error

Snipaste_2022-09-04_17-28-28

moblie env

why does this error occur, but there is no useful troubleshooting info in the error object.