fix(web): place sharp @img closure next to the pnpm-store copy Next loads#73
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (finally)
Server diagnostics showed our
@imgclosure (with the correctlibvips-cpp.so.8.18.3) was present atapps/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 the8.18.3our sharp 0.35.2 needs. Sodlopenkept failing.Fix
Copy
sharp+ the full@imgclosure into every matching sharp home in the bundle:node_modules/.pnpm/sharp@<ver>/node_modules/(the path Next actually resolves) ← the real fixapps/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) →dlopenresolves.pnpm lint+ build green.