JonasKruckenberg / imagetools

Load and transform images using a toolbox :toolbox: of custom import directives!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v6 broken due to missing sharp 0.33 binariers

chojnicki opened this issue · comments

I've upgraded Vite 4 to 5 and all plugins, and only imagetools broke.

frontend-1  | failed to load config from /usr/src/front/vite.config.js
frontend-1  | error when starting dev server:
frontend-1  | Error: Could not load the "sharp" module using the linux-x64 runtime
frontend-1  | Possible solutions:
frontend-1  | - Ensure optional dependencies can be installed:
frontend-1  |     npm install --include=optional sharp
frontend-1  |     yarn add sharp --ignore-engines
frontend-1  | - Ensure your package manager supports multi-platform installation:
frontend-1  |     See https://sharp.pixelplumbing.com/install#cross-platform
frontend-1  | - Add platform-specific dependencies:
frontend-1  |     npm install --os=linux --cpu=x64 sharp
frontend-1  | - Consult the installation documentation:
frontend-1  |     See https://sharp.pixelplumbing.com/install
frontend-1  |     at Object.<anonymous> (/usr/src/front/node_modules/sharp/lib/sharp.js:114:9)
frontend-1  |     at Module._compile (node:internal/modules/cjs/loader:1376:14)
frontend-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
frontend-1  |     at Module.load (node:internal/modules/cjs/loader:1207:32)
frontend-1  |     at Module._load (node:internal/modules/cjs/loader:1023:12)
frontend-1  |     at Module.require (node:internal/modules/cjs/loader:1235:19)
frontend-1  |     at require (node:internal/modules/helpers:176:18)
frontend-1  |     at Object.<anonymous> (/usr/src/front/node_modules/sharp/lib/constructor.js:10:1)
frontend-1  |     at Module._compile (node:internal/modules/cjs/loader:1376:14)
frontend-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Of course I'm not going to install sharp manually like advised in console - it's dependency of imagetools so it should work out of the box like before.

I found same issues sharp v0.33, but they are marked as solved because this supposed to be bug with Vercel which was fixed, but Vercel is not used here :P

lovell/sharp#3870
lovell/sharp#3900

What I tried:

  • purging node_modules and lock file for fresh binaries - same
  • changing node 18 to 20 - same
  • downgrading imagetools from 6 to 5 - working

It's indeed something with sharp, because when there is 0.33 in lock file it crashesh, but downgrading sharp by downgrading imagetools helps


EDIT: version 6.1.0 also works. In changelog it states that sharp 0.33 was included in 6.2.7 so 6.2.6 should work fine but no, locking it to 6.2.6 still installs latest sharp.

Please report in the sharp repository

@benmccann but I'm using imagetools, not sharp. So this is correct repository for issue. Especially that author of sharp is saying that this not bug in sharp, but implementation. Even if it is bug in sharp, again, I'm not installing it. It is dependency of this library, so if You think that this version is defective, it should be downgraded here :)

No. That logic doesn't fly with any open source project. Maintainers can't possibly be responsible for bugs in all the libraries that they use. And those libraries also have their own dependencies. Many projects would be responsible for bugs in thousands of libraries at that rate. If you can show we've done something wrong in this project then we can address it. If you're using yarn this may be a duplicate of #659. Otherwise there's nothing to suggest there's a bug in this library