-
-
Notifications
You must be signed in to change notification settings - Fork 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
Could not load the "sharp" module using the win32-x64 runtime #2975
Comments
Install sharp if you are using asset server strategy:
|
Mate two things:
My question is why is included as part of core packages ? Since the entire architecture is strategy based why not let the end user install it IF AND ONLY IF they use |
It's a mess when doing automated builds because you depend on what's defined in package.json |
Hi @meyvan, thanks for the report Regarding the error itself, it may be the same as reported here
When you use
We do not ship any other asset preview strategy than the sharp one, which means that if we didn't include it in a standard installation, then if you try to upload images we would not be able to create previews. Can you try updating to Node v20 and see if that makes any difference? |
@michaelbromley I get it. But here is my visible confusion: I see previews being made as optional params, which led me to assume, those are in fact optional Second, the left panel shows Sharp Preview Strategy similar to AssetStorage and LocalStorage and underneath it. It led me to believe SharpPreview is a separate strategy and not part of Assets Storage. Maybe can it be included as a submenu underneath AssetStorageStragety ? |
I was under the assumption that if no preview related configurations are sent in, then no image will be transformed |
Still getting the same error mate, tried 20 and 22 |
Got it. To anyone who is using windows, use the below for local development and make sure to install the linux based when you are deploying. Not a great solution but the bug from Sharp as mentioned by @michaelbromley makes it as a necessity
|
@meyvan please reopen it. I'm experiencing the same issue on a linux machine, and I think having a long term solution helps. @michaelbromley it breaks between version 2.1.9 and 2.2.0. I had to upgrade from an earlier version to use a plugin and ran into this error. |
in v2.2.0 we upgraded the Sharp version, which is why the issue now appears. I think a work-around could be that we add the |
Some thoughts on reproducing the error:
|
@ziban did that resolve the issue? In case it did I would like to add it to our docs. Thanks! |
Yeah it resolved the issue, but I'm not certain if it will work for everyone. |
FWIW and because I haven't seen it mentioned yet, using |
It seems that this is an issue that is massively dependent on the OS. Right now there is no clear solution for that, a lot of the commands in the comments are a good approach to solve it. I will close this issue for now, if it comes up again we can re-open it at this point. |
Describe the bug
When I try to create a new installation by following https://docs.vendure.io/guides/getting-started/installation/ guide I get the followinf error:
To Reproduce
Steps to reproduce the behavior:
npm run dev
Expected behavior
Should run smoothly
Environment (please complete the following information):
Additional context
Sharp is only required if someone is using this strategy: https://docs.vendure.io/reference/core-plugins/asset-server-plugin/sharp-asset-preview-strategy
Why install it in the first place ? If someone wants to use it, let them install and use the strategy
Proposed Solution: Remove Sharp library as default and update docs to reflect the same
The text was updated successfully, but these errors were encountered: