modesty / pdf2json

converts binary PDF to JSON and text, for server-side PDF processing and command-line use.
https://github.com/modesty/pdf2json
Other
2.02k stars 377 forks source link

something is colossaly f***** up in the exports for version 3.1.0 #340

Closed philkunz closed 3 months ago

philkunz commented 6 months ago

Why is the default module suddenly 1.75MB and has no default export?

abrenoch commented 6 months ago

Unfortunately 3.1.1 is giving us trouble as well:

C:\...\node_modules\ts-node\dist\index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\...\node_modules\pdf2json\dist\pdfparser.js from C:\...\src\my-file.ts not supported.
Instead change the require of pdfparser.js in C:\...\src\my-file.ts to a dynamic import() which is available in all CommonJS modules.
    at require.extensions.<computed> [as .js] (C:\...\node_modules\ts-node\dist\index.js:851:20)
    at Object.<anonymous> (C:\...\src\my-file.ts:8:44)
    at m._compile (C:\...\node_modules\ts-node\dist\index.js:857:29) {
  code: 'ERR_REQUIRE_ESM'
}

3.0.5 seems to be fine

greguz commented 6 months ago

I can confirm this colossally on-point Issue :)