-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESM support #11
Comments
Woops, sorry! I'm still new to ESM support in Node.js. |
Despite my TS setup, which is surprisingly resilient to this error, I was able to write a test that fails based on your repro case:
I've now fixed that test and deployed that fix in v5.0.1. Please try that version out! |
Thanks very much. I ran into an issue with the new version of pdfjs-dist that I'll write here in case it helps someone. pdfjs-dist v4 uses Promise.withResolvers, which is not supported by Node until version 22. AWS Lambda will not add Node 22 runtime until November 2024. To continue using this library on supported runtimes, we downgraded back to pdf-text-reader@4 and added a line into read-pdf.js:
That workaround was suggested in the vulnerability report, so I believe everything is fine from a security perspective. Thanks again for addressing this so quickly. We'll upgrade to v5 as soon as we can. |
I ran into the same issue with Node versions. I can add an options input to |
Actually, looks like I already have that, but it's not being used, woops! |
I'll fix here: #12 |
export * from './read-pdf.js';
(add a .js to the end of the import location)Documentation: https://nodejs.org/api/esm.html#mandatory-file-extensions
Originally posted by @AaronSterlingGENEICD in #10 (comment)
Using Node v22:
To reproduce:
The text was updated successfully, but these errors were encountered: