niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.61k stars 4.81k forks source link

Angular 5 error: html2canvas_1.default is not a function #1561

Open seyidaniels opened 6 years ago

seyidaniels commented 6 years ago

I downloaded the latest version and lazy loaded the js file on my component which is showing when i go to inspect element-> network/js but i keep getting this error: ERROR TypeError: html2canvas_1.default is not a function .

Please kindly help! Currently on angular version 5.2.11 and angular cli version 1.7.4

capture

kusmaSingh commented 6 years ago

I'm also getting same problem with Angular 5 screenshot_36

ashishghone commented 6 years ago

i am getting similar error using Angular 4.4

wduvan commented 6 years ago

any solution?

ahmedtamseer commented 5 years ago

Possible duplicate of https://github.com/niklasvh/html2canvas/issues/1440

evilbdef commented 5 years ago

how to fix it ? using angular7 html2canvas@1.0.0-rc.3 Emergency

ws-tumx commented 5 years ago

@niklasvh

nitustena commented 5 years ago

any fixes on this?

charlesdevandiere commented 4 years ago

I found a fix. Import html2canvas this way :

import * as _html2canvas from "html2canvas";
const html2canvas: any = _html2canvas;

Works for me on Angular 5.