-
Notifications
You must be signed in to change notification settings - Fork 9
improve compatibility with newer node versions #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
Conversation
So you just want the canvas library to be updated? What exactly is the problem? |
(Not @prototype99, but) compiling our pdf.js version with Node 17 [on ARM In my case] always fails and can only be fixed by tinkering with the |
@AbeJellinek On Node 17 [on ARM as well] it fails for me to install puppeteer "The chromium binary is not available for arm64.". I haven't investigated further. Later this year we plan to catchup with the latest PDF.js version. But if you are saying that just updating canvas version makes everyone's life easier, we can do it now, of course. |
@mrtcode: You can fix that by adding export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH="/Applications/Chromium.app/Contents/MacOS/Chromium" to your shell config, assuming you have Chromium installed /Applications. |
Essentially: the combination of the package.json and the package-lock.json pulls in |
Thanks @AbeJellinek. That fixes the Chromium problem. Unfortunately, at least for me, canvas 2.8.0 still can be installed, so it seems this isn't the only problem.
|
hmm isn't darwin and arm64 the M1 macs? The location it tries to fetch from only has x64 darwin (intel macs?) prebuilt binaries. Does it work for you on an x86_64 device? Automattic/node-canvas#1662 may be the issue for arm, it appears that arm is a bit more involved, you have to follow this process: https://github.com/Automattic/node-canvas/wiki#installation-guides from what i can tell, m1 macs may additionally only work with version 2.9.0 onwards because it merges an m1 feature branch. hopefully this helps |
2.9.0 doesn't help. I can of course remove canvas module completely because it's not necessary for our PDF.js build.
So, again, we can update canvas module or even remove it, but that doesn't solve the problem completely if you still can't build on arm64. I guess there are more packages that have to be updated. In around half a year we will update to the latest PDF.js version, and hopefully all the problems with arm64 will be fixed. |
Even when canvas is manually built as described in the respective installation guide for your OS? it seemed to be suggested that canvas can then be installed on arm64 without issue (i've been assuming that's the only arm we're talking about) regardless, just to make sure I understand: either way as things are, arm support is broken for now, however removing canvas in general is a preferred solution, when compared to updating the version of canvas. It appears that the issue experienced with webpack is also to do with node 17, i'm not sure why i didn't experience it, however i wil explore solutions |
the issue you experienced should be fixed by |
f789c1a
to
80ad61d
Compare
I see now, the fact it was in the package.json was from a file conflict that resolved incorrectly. This new version rebases in and cherrypicks the original commit. I have rebased the entirety of the zotero pdf.js fork, I will explain further on zotero/zotero#2183 once I'm happy that all the commits are correct |
|
this is done by bumping the canvas package version. i have put the commit underneath pdf-reader's version to make sure rebasing is already done. Zotero built with this version of pdf.js had no immediately obvious issues, including opening and reading through a few pdfs.