-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error: The specified procedure could not be found. With sharp js. #930
Comments
I can reproduce this. Actual loader output:
Version of libcairo-2.dll provided by sharp indeed is missing that function: Versus the version of libcairo-2.dll provided by canvas: I don't know why it's missing from the sharp version. They package a newer version (1.14) than canvas uses on Windows with the normal install instructions (1.10), but in any case that method has been around since Cairo 1.2. Anyway, as far as I know, this is because when Windows searches for a DLL, if a DLL with the same module name is already loaded, that one will be used (see docs). Is it viable to require canvas before sharp at least for now? A quick attempt to use DLL redirection with a |
Thanks for the further investigation, the error makes sense now that the function is missing on the other lib. I have found an additional compilation however, the above workaround causes issues on Linux:
The SegFault appears to be caused by loading canvas before sharp. So my ammended workaround is the glorious: if (process.platform === 'win32') {
require('canvas');
require('sharp');
} else {
require('sharp');
require('canvas');
} (The OP issue does not present on Linux it appears). |
Hello, thanks to your investigation we discovered this was a problem with libvips' Windows build. libvips/build-win64#13 will fix this for the next release, which will be available in a future sharp v0.19.x. |
Great! Thanks for the feedback. |
Thanks @lovell ! It would still be nice to figure out how to get redirection working sometime so this can't happen in the first place. |
As of |
For anyone wondering. Running |
Has anyone found a configuration of versions for node-canvas and sharp that does work? Oddly only started experiencing this issue recently, was it reintroduced? I have a dependency that relies on the latest versions of these. Thinking of using |
@cloewen8 I believe this problem only affects Windows users that still rely upon GTK2 (2011) for |
Still an issue in 2022. |
Is there any workaround for this? Still an issue with: Node: 18.13.0 |
My workaround for now is to import node-canvas at the very beginning of the project and send a blank canvas to nirvana. This lets node-canvas and sharp work as usual.
When the fix comes sometime, this can simply be deleted again. |
you can fix this problem?? |
Error: The specified procedure could not be found. |
Appears to play well with Sharp 0.32.5, no workarounds. |
Issue or Feature
When using this with sharp js canvas fails to load.
Error: The specified procedure could not be found. *\node_modules\canvas\build\Release\canvas.node
Steps to Reproduce
Environment
The text was updated successfully, but these errors were encountered: