bpampuch / pdfmake

Client/server side PDF printing in pure JavaScript
http://pdfmake.org
Other
11.7k stars 2.04k forks source link

Build Project issue with pdfmake "0.2.7" version. #2802

Open ShamimMahmud25 opened 2 days ago

ShamimMahmud25 commented 2 days ago

Build error occurred TypeError: Cannot read properties of undefined (reading 'vfs') at 65638 (E:\FrontEnd\ffbd-admin.next\server\chunks\6887.js:1174:57) at webpack_require (E:\FrontEnd\ffbd-admin.next\server\webpack-runtime.js:25:42) at 33024 (E:\FrontEnd\ffbd-admin.next\server\pages\shopping-centre\sales-report.js:4888:17) at webpack_require (E:\FrontEnd\ffbd-admin.next\server\webpack-runtime.js:25:42) at webpack_exec (E:\FrontEnd\ffbd-admin.next\server\pages\shopping-centre\sales-report.js:8206:39) at E:\FrontEnd\ffbd-admin.next\server\pages\shopping-centre\sales-report.js:8207:202 at webpack_require.X (E:\FrontEnd\ffbd-admin.next\server\webpack-runtime.js:190:21) at E:\FrontEnd\ffbd-admin.next\server\pages\shopping-centre\sales-report.js:8207:47 at Object. (E:\FrontEnd\ffbd-admin.next\server\pages\shopping-centre\sales-report.js:8210:3) at Module._compile (node:internal/modules/cjs/loader:1256:14) { type: 'TypeError' } error Command failed with exit code 1.

I was using "pdfmake": "^0.2.7", it worked fine previously, but from yesterday it cause the build failure.

liborm85 commented 2 days ago

Version 0.2.7 is too old, update to latest version 0.2.15.

ShamimMahmud25 commented 2 days ago

I have updated it to 0.2.15, still issue exists.

liborm85 commented 2 days ago

Attach runnable example for reproduce issue.

mtrefzer commented 5 hours ago

I'm using typescript and and having the same issue. It seems like a problem with the latest @types/pdfmake@0.2.9.

Within vfs_fonts.d.ts there is the namespace, that doesn't match with the actual build of pdfmake@0.2.15:

export namespace pdfMake {
    let vfs: { [file: string]: string };
}
liborm85 commented 2 hours ago

Format VFS was changed i 0.2.15 for better compatibility with frameworks (see changelog). @types/pdfmake is not part of pdfmake, contact the author.