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

jokris1 picture jokris1  路  3Comments

kamilkp picture kamilkp  路  3Comments

ValeSauer picture ValeSauer  路  3Comments

dgrice picture dgrice  路  3Comments

kumarandena picture kumarandena  路  3Comments