Pdfmake: Uncaught TypeError: fs.readFileSync is not a function

Created on 14 Mar 2018  路  4Comments  路  Source: bpampuch/pdfmake

Hello. Get following error, when import package

linebreaker.js:15 Uncaught TypeError: fs.readFileSync is not a function
    at Object.eval (linebreaker.js:15)
    at Object.eval (linebreaker.js:161)
    at eval (linebreaker.js:163)
    at Object.<anonymous> (bundle.js:10711)
    at __webpack_require__ (bundle.js:556)
    at fn (bundle.js:87)
    at eval (textTools.js:7)
    at Object.<anonymous> (bundle.js:10702)
    at __webpack_require__ (bundle.js:556)
    at fn (bundle.js:87)

i found only one readFileSync, in pdfmake.min.js

Most helpful comment

In readme is described how to import pdfmake in js frameworks, see: https://github.com/bpampuch/pdfmake#using-javascript-frameworks

All 4 comments

Attach a sample of what you are doing. And what are you using client-side (browser) or server-side?

System

node 8.9.4
npm 5.6.0
yarn 1.3.2
Windows 10.

My actions

create-react-app pdfmake
cd pdfmake
yarn add pdfmake
Open App.js, add import pdfMake from "pdfmake" at the top
has error in Chrome 64.

repo with sample

In readme is described how to import pdfmake in js frameworks, see: https://github.com/bpampuch/pdfmake#using-javascript-frameworks

Omg, i'm a lazy idiot. Sorry, thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liborm85 picture liborm85  路  30Comments

revdave33 picture revdave33  路  22Comments

RodrigoInosh picture RodrigoInosh  路  36Comments

jimmyting44 picture jimmyting44  路  89Comments

jakubsadura picture jakubsadura  路  43Comments