title: error TS2351: This expression is not constructable. Type 'typeof import("jspdf")' has no construct signatures
body: <p>I want to convert html file to pdf file in my project, but I got an error, how can I fix my problem?</p>
  <pre><code>npm install jspdf
  </code></pre>
  <p>DownloadCvCompanent.ts:</p>
  <pre><code>import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
  import * as jsPDF from 'jspdf'
  @Component({
    selector: 'app-download-cv',
    templateUrl: './download-cv.component.html',
    styleUrls: ['./download-cv.component.scss']
  })
  export class DownloadCvComponent implements OnInit {
    constructor() { }
    ngOnInit(): void {}
    @ViewChild('htmlData') htmlData:ElementRef;
    USERS = [
      {
        &quot;id&quot;: 1,
        &quot;name&quot;: &quot;Leanne Graham&quot;,
        &quot;email&quot;: &quot;sincere@april.biz&quot;,
        &quot;phone&quot;: &quot;1-770-736-8031 x56442&quot;
      },
      {
        &quot;id&quot;: 2,
        &quot;name&quot;: &quot;Ervin Howell&quot;,
        &quot;email&quot;: &quot;shanna@melissa.tv&quot;,
        &quot;phone&quot;: &quot;010-692-6593 x09125&quot;
      },
      {
        &quot;id&quot;: 3,
        &quot;name&quot;: &quot;Clementine Bauch&quot;,
        &quot;email&quot;: &quot;nathan@yesenia.net&quot;,
        &quot;phone&quot;: &quot;1-463-123-4447&quot;,
      },
      {
        &quot;id&quot;: 4,
        &quot;name&quot;: &quot;Patricia Lebsack&quot;,
        &quot;email&quot;: &quot;julianne@kory.org&quot;,
        &quot;phone&quot;: &quot;493-170-9623 x156&quot;
      },
      {
        &quot;id&quot;: 5,
        &quot;name&quot;: &quot;Chelsey Dietrich&quot;,
        &quot;email&quot;: &quot;lucio@annie.ca&quot;,
        &quot;phone&quot;: &quot;(254)954-1289&quot;
      },
      {
        &quot;id&quot;: 6,
        &quot;name&quot;: &quot;Mrs. Dennis&quot;,
        &quot;email&quot;: &quot;karley@jasper.info&quot;,
        &quot;phone&quot;: &quot;1-477-935-8478 x6430&quot;
      }
    ];
    public openPDF():void {
      let DATA = this.htmlData.nativeElement;
      let doc = new jsPDF('p','pt', 'a4');
      doc.fromHTML(DATA.innerHTML,15,15);
      doc.output('dataurlnewwindow');
    }
    public downloadPDF():void {
      let DATA = this.htmlData.nativeElement;
      let doc = new jsPDF('p','pt', 'a4');
      let handleElement = {
        '#editor':function(element,renderer){
          return true;
        }
      };    
      doc.fromHTML(DATA.innerHTML,15,15,{
        'width': 200,
        'elementHandlers': handleElement
      });
      doc.save('angular-demo.pdf');
    }
  
  }
  </code></pre>
  <p>DownloadCvCompanent.html:</p>
  <pre><code>&lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row&quot;&gt;
  
          &lt;div class=&quot;col-md-8&quot; id=&quot;htmlData&quot; #htmlData&gt;
              &lt;table class=&quot;table table-bordered&quot;&gt;
                  &lt;tr class=&quot;table-primary&quot;&gt;
                      &lt;th&gt;Id&lt;/th&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Email&lt;/th&gt;
                      &lt;th&gt;Phone&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;tr *ngFor=&quot;let user of USERS&quot;&gt;
                      &lt;th&gt;{{user.id}}&lt;/th&gt;
                      &lt;td&gt;{{user.name}}&lt;/td&gt;
                      &lt;td&gt;{{user.email}}&lt;/td&gt;
                      &lt;td&gt;{{user.phone}}&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;col-md-4 text-right&quot;&gt;
              &lt;button class=&quot;btn btn-success btn-block&quot; (click)=&quot;openPDF()&quot;&gt;Open PDF&lt;/button&gt;
              &lt;button class=&quot;btn btn-danger btn-block&quot; (click)=&quot;downloadPDF()&quot;&gt;Download PDF&lt;/button&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>error in terminal:</p>
  <pre><code>ERROR in src/app/layout/home/download-cv/download-cv.component.ts:57:19 - error TS2351: This expression is not constructable.
    Type 'typeof import(&quot;jspdf&quot;)' has no construct signatures.
  
  57     let doc = new jsPDF('p','pt', 'a4');
                       ~~~~~
  src/app/layout/home/download-cv/download-cv.component.ts:66:19 - error TS2351: This expression is not constructable.
    Type 'typeof import(&quot;jspdf&quot;)' has no construct signatures.
  
  66     let doc = new jsPDF('p','pt', 'a4');
  </code></pre>
  <p>error in console (after click button Download PDF;</p>
  <pre><code>core.js:6241 ERROR TypeError: jspdf__WEBPACK_IMPORTED_MODULE_1__ is not a constructor
      at DownloadCvComponent.downloadPDF (download-cv.component.ts:66)
      at DownloadCvComponent_Template_button_click_18_listener (download-cv.component.html:23)
      at executeListenerWithErrorHandling (core.js:21860)
      at wrapListenerIn_markDirtyAndPreventDefault (core.js:21902)
      at HTMLButtonElement.&lt;anonymous&gt; (platform-browser.js:976)
      at ZoneDelegate.invokeTask (zone-evergreen.js:399)
      at Object.onInvokeTask (core.js:41686)
      at ZoneDelegate.invokeTask (zone-evergreen.js:398)
      at Zone.runTask (zone-evergreen.js:167)
      at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:480)
  </code></pre>
  <p>package.json:</p>
  <pre><code> { 
     ...
      &quot;jspdf&quot;: &quot;^2.3.0&quot;,
     ...
   }
  </code></pre>
  <p><strong>How do I fix my problem?</strong></p>