opengovsg / pdf2md

A PDF to Markdown converter
https://www.npmjs.com/package/@opendocsg/pdf2md
MIT License
205 stars 40 forks source link

Patch update was a breaking change - requires node 22 #87

Open abrenneke opened 5 months ago

abrenneke commented 5 months ago

Describe the bug The change here switched from pdfjs-dist/legacy/build to pdfjs-dist/build. The non-legacy import uses Promise.withResolvers, which is only supported in Node 22+.

We have a case where a lockfile isn't used, so the new version was automatically pulled in and stopped working because it uses Node 18 :(

To Reproduce

  1. Try to run latest version of the library in Node 18 or 20.

Expected behavior Works

sarve-shreyas commented 2 months ago

Does anyone have fix for this ?

tonisives commented 1 month ago

This is a critical issue with the project. node22 is not LTS version, and therefore isn't supported on major platforms like AWS Lambda.

As a temporary fix, you can use the older version: "@opendocsg/pdf2md": "0.1.29",