title: html2canvas: Error Uncaught (in promise): [object undefined] angular 6
body: <p>I am using html2canvas to convert html to image, then export as pdf file. Here is my steps using this package:</p>
  
  <ol>
  <li><p>yarn add html2canvas</p></li>
  <li><p>add code to convert html to image.</p>
  
  <pre><code>async export(comp, doc, save) {
    // create pdf file
    let height = REPORT_PAGE.top;
    const header = comp.reportHeader.nativeElement;
    const headerCanvas = await html2canvas(header, {svgRendering: true});
    height = REPORT_PAGE.top;
    let imgHeightHtml = REPORT_PAGE.header * REPORT_PAGE.width / headerCanvas.width;
    let contentDataURL = headerCanvas.toDataURL('image/png');
    doc.addImage(contentDataURL, 'PNG', REPORT_PAGE.left, height, REPORT_PAGE.width, imgHeightHtml);
    if (save) {
      doc.save('myreport.pdf');
    } else {
      doc.addPage();
    }
  }
  </code></pre></li>
  </ol>
  
  <p>where comp is the angular component, doc is jsPDF, save is boolean. The following error will throw when the html2canvas is called.</p>
  
  <pre><code>Uncaught (in promise): [object Undefined]
  at resolvePromise (zone.js:814)
  at resolvePromise (zone.js:771)
  at zone.js:873
  at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
  at Object.onInvokeTask (core.js:4053)
  at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
  at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
  at drainMicroTaskQueue (zone.js:595)
  at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:500)
  at ZoneTask.invoke (zone.js:485)
  </code></pre>
  
  <p>html2canvas is a very useful package, but this error is really bad. Please help.</p>