22 | function getLens (b64) {
23 | var len = b64.length
24 |
25 | if (len % 4 > 0) {
26 | throw new Error('Invalid string. Length must be a multiple of 4')
^
error: Invalid string. Length must be a multiple of 4
at getLens (/Users/user/code/app/node_modules/@foliojs-fork/linebreak/node_modules/base64-js/index.js:26:10)
at toByteArray (/Users/user/code/app/node_modules/@foliojs-fork/linebreak/node_modules/base64-js/index.js:55:13)
at /Users/user/code/app/node_modules/@foliojs-fork/linebreak/src/linebreaker.js:7:13
at globalThis (/Users/user/code/app/node_modules/@foliojs-fork/linebreak/src/linebreaker.js:200:17)
at overridableRequire (:1:20)
at /Users/user/code/app/node_modules/@foliojs-fork/pdfkit/js/pdfkit.js:9:4
at globalThis (/Users/user/code/app/node_modules/@foliojs-fork/pdfkit/js/pdfkit.js:6441:17)
at overridableRequire (:1:20)
at /Users/user/code/app/node_modules/pdfmake/src/pdfKitEngine.js:7:13
at globalThis (/Users/user/code/app/node_modules/pdfmake/src/pdfKitEngine.js:21:0)
at overridableRequire (:1:20)
at /Users/user/code/app/node_modules/pdfmake/src/printer.js:4:4
at globalThis (/Users/user/code/app/node_modules/pdfmake/src/printer.js:709:17)
at processTicksAndRejections (:61:76)
repro: install bun as here https://bun.sh/docs/installation
import PdfPrint from "pdfmake";
bun file.js
Stack trace im getting
22 | function getLens (b64) { 23 | var len = b64.length 24 | 25 | if (len % 4 > 0) { 26 | throw new Error('Invalid string. Length must be a multiple of 4') ^ error: Invalid string. Length must be a multiple of 4 at getLens (/Users/user/code/app/node_modules/@foliojs-fork/linebreak/node_modules/base64-js/index.js:26:10) at toByteArray (/Users/user/code/app/node_modules/@foliojs-fork/linebreak/node_modules/base64-js/index.js:55:13) at /Users/user/code/app/node_modules/@foliojs-fork/linebreak/src/linebreaker.js:7:13 at globalThis (/Users/user/code/app/node_modules/@foliojs-fork/linebreak/src/linebreaker.js:200:17) at overridableRequire (:1:20) at /Users/user/code/app/node_modules/@foliojs-fork/pdfkit/js/pdfkit.js:9:4 at globalThis (/Users/user/code/app/node_modules/@foliojs-fork/pdfkit/js/pdfkit.js:6441:17) at overridableRequire (:1:20) at /Users/user/code/app/node_modules/pdfmake/src/pdfKitEngine.js:7:13 at globalThis (/Users/user/code/app/node_modules/pdfmake/src/pdfKitEngine.js:21:0) at overridableRequire (:1:20) at /Users/user/code/app/node_modules/pdfmake/src/printer.js:4:4 at globalThis (/Users/user/code/app/node_modules/pdfmake/src/printer.js:709:17) at processTicksAndRejections (:61:76)