Repository navigation
Fix the provider bundle test: put sharp back at the top level - #3482
Merged
Merged
Conversation
sharp is a native module and is deliberately external to the bundle; the provider image installs it beside the bundle at build time. The bundle test runs it straight out of packages/cli/dist/bundle, which has no node_modules, so resolution walks up to the workspace root — where npm's hoisting happened to leave sharp. pnpm links a package only under whatever asked for it, and only @prosopo/puzzle-assets asks for sharp, so the bundle test has failed with ERR_MODULE_NOT_FOUND on every branch cut after the pnpm migration. publicHoistPattern puts it back at the root. Declaring it on @prosopo/cli instead also works, but the CLI's sources never import it and lint:refs rightly rejects a dependency nothing imports. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forgetso
force-pushed
the
fix/cli-bundle-sharp-resolution
branch
from
October 2, 2026 10:29
3bc22c0 to
a09a5f8
Compare
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.
What's broken
@prosopo/cli's bundle test fails on every branch cut after the npm→pnpm migration (#3447), so every open PR is red. The error is:Why
sharpis a native image library. It is deliberately not put inside the bundle — bundling its JavaScript part without the matching platform binary breaks the provider at runtime, which is whyvite.backend.config.tskeeps it on the externals list and the provider Dockerfile installs it next to the bundle instead.So the bundle expects to find
sharpsomewhere nearby when it runs. The test runs it frompackages/cli/dist/bundle/, which has nonode_modulesof its own, so Node looks in each parent folder up to the top of the repo. npm used to put every package at the top, sosharpwas always found there. pnpm only puts a package where something actually asked for it, and the only thing that asks forsharpis@prosopo/puzzle-assets. Nothing nearby, nothing found.What changed
One setting in
pnpm-workspace.yamltelling pnpm to also putsharpat the top level, which is where it used to be:Nothing about the bundle changes:
sharpis still external, and the Docker image still installs it exactly as before.The other way to fix it is to list
sharpas a dependency ofpackages/cli. That works too — I pushed it first and the bundle test went green — butlint:refsthen fails, correctly, because no file inpackages/cliimportssharp. Hoisting is the honest fix: it is an install-layout problem, not a missing dependency.How it was verified
testsrun went green, confirmingsharpresolution was the only thing wrong.B/dist/bundle/): resolution fails as shipped, and succeeds underpublicHoistPattern.🤖 Generated with Claude Code