Repository navigation
Conversation
papra 26.6.2 dropped `nodeLinker: hoisted` from pnpm-workspace.yaml (adding
injectWorkspacePackages instead), reverting pnpm to its default isolated
linker. sharp is a transitive dep (@papra/lecture -> sharp), so it moved from
/app/production/node_modules/sharp to
/app/production/node_modules/.pnpm/sharp@0.34.5/node_modules/sharp.
The wasm-fallback guard read that path literally and died with ENOENT before it
could compare versions, breaking every build since 26.6.2.
Resolve sharp with createRequire from @papra/lecture's manifest instead. That
works under either linker layout and is the same resolution the app performs at
runtime, so the require('sharp') load test now exercises the real path.
@img/sharp-wasm32 is still read by literal path: the tar-merge step places it at
the top level itself, so it is not subject to the linker layout.
Also corrects the now-stale `nodeLinker: hoisted` comment above the dependency
pinning step, which survived the change only because it already tried two
lookup bases.
Verified against fixtures mirroring both pnpm layouts plus a version-drift case:
isolated resolves from the virtual store, hoisted still resolves at top level,
and drift still fails with the actionable message.
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.
Summary
The
latestbuild has failed since papra 26.6.2. The sharp/wasm32 version guard readsnode_modules/sharp/package.jsonby literal path, but 26.6.2 changed pnpm's linker sosharpis no longer at that path.Resolve
sharpthrough@papra/lecturewithcreateRequireinstead, which works undereither linker layout and matches how the application loads it at runtime.
Environment
ghcr.io/daemonless/papra:latest@img/sharp-wasm32@papra/lectureSymptom
ContainerfileSTEP 20/22 fails:Root cause
papra 26.6.2 changed
pnpm-workspace.yaml:Dropping
nodeLinker: hoistedreverts pnpm to its default isolated linker.sharpis atransitive dependency (
@papra/lecture→sharp), so it is no longer hoisted to the top ofthe deployed tree:
/app/productionnode_modules/sharpnode_modules/.pnpm/sharp@0.34.5/node_modules/sharpThe guard's literal path only ever matched the hoisted layout.
Evidence
sharp@0.34.5does install in the workspace — the build log shows its install scriptrunning (
.../sharp@0.34.5/node_modules/sharp install: Done) well before the failing step.It is present, just not where the guard looks.
Virtual store is at: ../app/production/node_modules/.pnpm, confirmingthe isolated layout.
@papra/lectureat/app/production/node_modules/@papra/lecture,still passes:
@papra/lectureis a direct dependency ofapp-server, so it stays at thetop level under both linkers. Only the transitive dependency moved.
Ruled out
@papra/lecturedropping sharp —packages/lecture/package.jsonis byte-identicalbetween 26.6.1 and 26.6.2 (
sharp: catalog:, version 0.5.1 in both).app-serverdropping lecture —apps/papra-server/package.jsondeclares@papra/lecture: workspace:*in both tags, unchanged.sharp: ^0.34.5in both tags, so the@img/sharp-wasm32@0.34.5pin is still correct. This is not version drift; the guard nevergot far enough to compare versions.
previous fix and its generated-file follow-up; neither touches this step.
Fix
Resolve sharp via
createRequirefrom@papra/lecture's manifest:This is layout-agnostic, and it exercises the same resolution the application performs at
runtime rather than an approximation of it.
require('sharp')is likewise called through thatrequire, so the wasm load test now runs from the context that actually loads sharp.
@img/sharp-wasm32continues to be read by literal path: the tar-merge step places it at thetop level itself, so it is not subject to the linker layout. sharp still finds it by walking up
from the virtual store to
/app/production/node_modules.The stale
nodeLinker: hoistedcomment above the dependency-pinning step is corrected in thesame commit — that step survived the change only because it already tried two lookup bases.
Testing
The guard logic was exercised against three fixtures built to mirror pnpm's on-disk layouts,
run under node 26.7.0 in a throwaway container from this image:
.pnpm, symlinked into lecture)VERSION DRIFTmessage intactNot yet validated by a full image build; the CI run on this PR is the real test.
Note on build timeouts
Three of the four runs since 26.6.2 ended by timing out rather than failing fast — one was
cancelled at the 6-hour job limit. Those look like interactive debug sessions held open rather
than a second defect, but worth confirming the runner isn't left waiting after a build failure.