Monday, 3 April 2017

pdfmake - fs.readFileSync is not a function error

I'm trying to use this lib: https://www.npmjs.com/package/pdfmake. I have installed it with npm, and I'm importing it using webpack 2.

The browser console shows this error:

fs.readFileSync is not a function error

The examples in the library website are importing the javascript files and generating the PDF, everything in the front-end. But this code seems to be a server-side nodejs code. That's confusing.

How do I proceed with this question?

Thanks in advance



via Alex Alonso

No comments:

Post a Comment