Dom-to-image: Node (running on Heroku)

Created on 1 May 2017  ·  15Comments  ·  Source: tsayen/dom-to-image

Says HTMLCanvasElement is not defined, I am trying to use JSDOM with this.

Most helpful comment

Same issue. How do you make this work server-side...

All 15 comments

@theonlygusti

Facing the same issue here. I'm trying to include dom-to-image in the gulp task that compiles my template (handlebars/panini).

I'm also using jsdom (gulp-dom) and getting the same error. I guess that since there is no window there is also no HTMLCanvasElement.

Is there an easy way to make this work also server side?

Same issue. How do you make this work server-side...

same issue

Me too facing this issue

https://github.com/tmpvar/jsdom/wiki/Don't-stuff-jsdom-globals-onto-the-Node-global

JSDOM have been clearer on Canvas Support:
https://github.com/jsdom/jsdom#canvas-support

Does this resolve the original issue and dom-to-image will work in jsdom?

Any progress so far?

Same issue, says "ReferenceError: SVGRectElement is not defined".

@theonlygusti I want to ask you whether solve this problem yet?

HTMLCanvasElement未定义,我正在尝试与此一起使用JSDOM。
这个问题解决了吗

@theonlygusti 这个问题解决了吗

有人可以使用在node中了吗

It seems that dom-to-image has to work within a browser, see this issue #34

Does anyone has managed to make this running server side?

Can take a look at this answer on stackoverflow.

Instead of using JSdom and dom-to-image, you can make use of puppeteer which is a headless chrome nodejs API.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhpSriptKiddie picture PhpSriptKiddie  ·  4Comments

shahebaz444 picture shahebaz444  ·  5Comments

piyushSinghalDemo picture piyushSinghalDemo  ·  8Comments

DanielZambranoC picture DanielZambranoC  ·  5Comments

distroyq picture distroyq  ·  6Comments