Html2canvas: Chrome: Uncaught (in promise)

Created on 15 Dec 2017  路  7Comments  路  Source: niklasvh/html2canvas

Tested in:

  • Latest Chrome (stable)
  • Latest Chromium
  • Latest Firefox Developer Edition

I made a little something using html2canvas (stevenliebregt.github.io/html2png). I use html2canvas to create a png of the preview window. Locally this works great, but when hosted on GitHub Pages, the image is cut of at the bottom and the console gives me an Uncaught (in promise) without any further info.

It does work fine hosted on GitHub Pages on Firefox Developer Edition though.

Bug

Most helpful comment

There should be a catch handler in the promise call in line 166 in Clone.js.

this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {

Fixed it by adding it. @niklasvh @StevenLiebregt

All 7 comments

It's working fine for me in Chrome. To get more detailed info about the error, use the non-minified version of the library.

I now use the non-minified version, the error message says: unable to load image. Once again, it works fine in firefox-developer, but fails in google-chrome-stable

Are you using any browser extensions? If so, could you try turning them off?

Found out the issue, the Chrome Grammarly Plugin probably does something to the textareas, which breaks the image capturing.

Ideally, extensions wouldn't break the rendering though. Will keep this open as something to look into.

There should be a catch handler in the promise call in line 166 in Clone.js.

this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {

Fixed it by adding it. @niklasvh @StevenLiebregt

@LasithaPrabodha 's solution works for me as well. Is there any chance to push a new tag with the fix?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rrutkows picture rrutkows  路  4Comments

wbarrantes picture wbarrantes  路  3Comments

tibewww picture tibewww  路  4Comments

yasergh picture yasergh  路  5Comments

koreanman picture koreanman  路  4Comments