Skip to content

fix(web): place sharp @img closure next to the pnpm-store copy Next loads#73

Merged
Musiker15 merged 1 commit into
mainfrom
fix/sharp-pnpm-location
Jun 21, 2026
Merged

fix(web): place sharp @img closure next to the pnpm-store copy Next loads#73
Musiker15 merged 1 commit into
mainfrom
fix/sharp-pnpm-location

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Root cause (finally)

Server diagnostics showed our @img closure (with the correct libvips-cpp.so.8.18.3) was present at apps/web/node_modules/@img — but Next loads sharp from the standalone root pnpm store: node_modules/.pnpm/sharp@0.35.2/node_modules/sharp. There, Next had traced only a mismatched libvips (8.17.3, version 1.2.4 — for the transitive sharp 0.34.5), not the 8.18.3 our sharp 0.35.2 needs. So dlopen kept failing.

Fix

Copy sharp + the full @img closure into every matching sharp home in the bundle:

  • node_modules/.pnpm/sharp@<ver>/node_modules/ (the path Next actually resolves) ← the real fix
  • apps/web/node_modules/ (fallback)

The closure is version-matched (derived from the resolved sharp@<ver> store dir), so the right libvips lands next to the loaded sharp.

Verified

Local build copies sharp + @img (colour, platform binary, libvips) into both locations. On the Linux deploy build the pnpm-store copy gets @img/sharp-libvips-linux-x64 (8.18.3) → dlopen resolves. pnpm lint + build green.

…oads

#71/#72 copied the @img closure into apps/web/node_modules, but Next loads sharp
from the standalone ROOT pnpm store
(node_modules/.pnpm/sharp@<ver>/node_modules/sharp) — where only a mismatched
libvips (8.17.3, for the transitive sharp 0.34.5) had been traced, not 8.18.3
for our sharp 0.35.2. So dlopen still failed.

Copy sharp + the full @img closure into *every* matching sharp home in the
bundle: the pnpm-store path Next actually resolves, plus apps/web/node_modules
as a fallback. Verified both receive the closure (incl. libvips at the right
version on the Linux build).
@Musiker15 Musiker15 merged commit b220f0a into main Jun 21, 2026
3 checks passed
@Musiker15 Musiker15 deleted the fix/sharp-pnpm-location branch June 21, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant