-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
TypeError: DOMException is not a constructor after updating to 3.5.141 #16255
Comments
WFM when running your code locally, using Node.js Does it perhaps work if you update to Node.js version Please see https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):
|
I did install all necessary requirements as far as I am aware since the code runs without issues in the previous version of pdfjs. I installed it through the pdfjs-dist package and manually had to install canvas + the dependencies specified by it for macOS and Alpine Linux. The code is adapted from this node example with mainly swapping out the promises for async/await syntax. Further sharing of my code outside of this snippet is unfortunately not really possible since it is a commercial project. But this part of the code is relatively self-contained as it will be a new module accepting either pdf files or (as in the example above) a URL as input and returning post-processed text content. I have not tested updating to Node 18 yet but will try it out. Currently I am on vacation, so I will only get to it in 2 weeks unfortunately. |
Please note that Without being able to test your exact code/setup, in the form of a reduced and directly runnable test-case, it's probably going to be very difficult for anyone to help unfortunately.
Let's close this for the time being, since we try to avoid leaving non-actionable issues open. |
I am experiencing the same error after updating to 3.5.141. Downgrading to 3.4.120 removed the error. I am using pdfjs-dist via this library on the official Node.js 16.20.0 Alpine 3.17 Docker image. |
On the Dependabot PR simonhaenisch/md-to-pdf#188 with @Snuffleupagus I checked the changelog and there's a note about setting Node 16 as minimum version which was from your PR #16123 but clearly it's not fully compatible with Node 16. Your note about your code base not using Please feel free to use the relatively simple test cases for reproduction with Node 16: https://github.com/simonhaenisch/md-to-pdf/blob/master/src/test/api.spec.ts#L82-L112 (implementation of Please reopen the issue 🙏 |
I experienced the same problem. I just wanted to do this: https://github.com/mozilla/pdf.js/blob/master/examples/node/getinfo.js Node: v16.10.0 Downgrading to 3.4.120 worked. |
@Zirafnik not sure you saw but it already got fixed so you just need to wait for the next version. |
@simonhaenisch Ah, my bad, I definitely did not notice that. |
Attach (recommended) or Link to PDF file here:
https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
(Happens with any pdf-file)
Configuration:
Steps to reproduce the problem:
input
parameter should be the url):const doc = await loader.promise;
with the following error:What is the expected behavior? (add screenshot)
The pdf should get loaded and the text extracted (this worked as expected in the previous version 3.4.120)
What went wrong?
The pdf cannot be loaded, see above for the error message
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): N/A
The text was updated successfully, but these errors were encountered: