Skip to content

How to use jsPDF in node? Gets _jspdf2.default is not a constructor error #783

Closed
@THPubs

Description

@THPubs

I tried to import jspdf like this in my node app :

import jsPDF from 'jspdf';

Then tried to use the example code :

var doc = new jsPDF();
doc.text(20, 20, 'Hello world.');
doc.save('Test.pdf');

Then I get an error saying _jspdf2.default is not a constructor error. What is the right way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions