Closed Matojeje closed 6 months ago
Fixed the issue by using the legacy version of pdf.js.
In lib/PdfDataParser.js:
const { getDocument } = await import("pdfjs-dist/legacy/build/pdf.mjs");
Odd that it was working when testing on Windows 11, but when I installed the package on Rocky Linux I ran into the same issue with Node.js not supporting Promise.withResolvers, yet.
Published pdf-data-parser 1.2.9 with the fix.
Hello, I tried running the CLI on multiple systems and no matter the input file, the output always looks something like this:
Running this on different Node versions or operating systems would only change the displayed filepaths somewhat, but the stack trace stays the same.
The problem seems to be upstream in the pdf.js library (namely this bit of code), where this pull request created this issue.
I temporarily got around it by manually editing pdf-data-parser's
package.json
to require an earlier version thanpdfjs-dist@4.1.392
where this issue started to appear.