-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
pdfjs-dist: Jest failures with optional dependency canvas for ARM macs #16463
Comments
The |
@Snuffleupagus I understand you have attempted to use the optionalDependencies object, unfortunately the package is still installed into node_modules, but the build folder is empty. I'll poke the jsdom maintainers instead, perhaps they can make a more robust check. |
In case anyone else comes across the same issue, I have a horrible little workaround which works in my case. Note that this will mean that if you need to use a canvas in a node environment this will not help you. We are using |
@MattyBalaam's solution is horrible but work. |
Yep, it certainly is! |
Came across this as well after installing pdfjs-dist |
Configuration:
Steps to reproduce the problem:
canvas
dependency (there are no prebuilt binaries), but notice the install continuesjest
tests which usejest-environment-jsdom
. (no need to includepdfjs-dist
anywhere)This really feels like probably a
jsdom
andcanvas
issue, but in the absence of thecanvas
maintainer providing ARM binaries, is there a possible workaround anyone can suggest to stop this chain?I have wondered if there is any way of uninstalling
canvas
programatically after install for example? Or perhaps there should be a browser-only fork of pdfjs-dist. The other option is quite drastic and would involve copying over the compiled build files.The text was updated successfully, but these errors were encountered: