-
Notifications
You must be signed in to change notification settings - Fork 10
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
Could not load the "sharp" module using the win32-x64 runtime when using webpack #69
Comments
Hi @Markos-Vasalos, would you be able to post any related logs? I'm seeing some related issues in the sharp module (we had to recently upgrade to the latest version due to an issue we were having on our automation). Additionally, does |
Hello @dkozma and thank you for your quick reply! First of all webpack gives me these warnings (not sure if they are related) WARNING in ./node_modules/sharp/lib/libvips.js 60:13-54 WARNING in ./node_modules/sharp/lib/libvips.js 69:11-54 WARNING in ./node_modules/sharp/lib/sharp.js 24:12-25 WARNING in ./node_modules/sharp/lib/utility.js 72:17-54 And ends up with: webpack 5.90.1 compiled with 23 warnings in 2282 ms Error: Could not load the "sharp" module using the win32-x64 runtime
I've tried various solutions like installing sharp separately or using specific --os and --cpu flags like the ones specified above but the issue persists. If you need specific logs let me know. Also i tried c2pa-node@0.5.19 but i got the same results. |
I'm thinking it may have to do with this change: lovell/sharp#3750 Which package manager are you using? I see that the author recommends the latest version of |
Unfortunately i'm only using npm, version 10.4.0 and my node is 20.10.0 |
@dkozma After checking further, the issue is not with the c2pa but with the webpack. If i add webpack in a new project and run it, it produces the same error, even though without webpack is working fine. Steps to reproduce are the following: create a new empty node project and add the following code inside index.js ` const c2pa = createC2pa(); async function read(path, mimeType) {
} await read('signed.jpg', 'image/jpeg'); If you install the c2pa-node through npm and add inside the project a c2pa signed image with the name "signed.jpg" and run it using For the above error, i've installed webpack doing `const path = require('path') module.exports={ Then run it with the script
Is any other way c2pa-node can work with webpack? |
You can also have it run using this optional version of sharp. Made it work for me locally on my Win64 machine.
|
Hi @Markos-Vasalos, I'm not used to seeing Node packages being used with Webpack that often, so I'm not sure what its doing under the hood, however I wonder if it is trying to post-process some of the packages and causing issues. What happens if you try to add |
@SteveMaier-IRT tried it but unfortunately it doesn't work with webpack @dkozma Tried it and it changed the error. Now it complaints that it cannot find the module. Surely webpack does optimizations in dependencies under the hood so it probably breaks something. I might work with a different bundler if necessary instead of webpack. Thank you very much for your effort so far |
Also experiencing this issue. Did you ever figure out a solution? |
@joshh20 I just stopped using webpack. It wasn't necessary for my project eventually. |
@Markos-Vasalos Thank you. |
I've installed the c2pa-node library through npm, but as soon as i try to build my node app (i'm using webpack for this), i get the following error: "Could not load the "sharp" module using the win32-x64 runtime". (i'm running on windows 11)
The c2pa-node version currently installed is 0.5.20.
Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: