Skip to content

Run the Box that was installed alongside Parcel - #10

Merged
simonhamp merged 1 commit into
mainfrom
box-path
Nov 20, 2026
Merged

simonhamp merged 1 commit into
mainfrom
box-path

Conversation

@simonhamp

Copy link
Copy Markdown
Member

parcel compile fails when Parcel is installed from Packagist unless the right box happens to be first on your PATH:

The compactor class "Parcel\Compactor\RealPathMod" does not exist.

Box has to load Parcel's compactors, so it needs an autoloader that has Parcel in it. compile looked for Box in the project's vendor/bin, then in Parcel's own vendor/bin, then on the PATH. Parcel only has its own vendor/ in a git checkout. When it's installed as a package, Box sits next to it in the shared vendor/, so compile fell through to the PATH. On my machine that found an unrelated global Box, which knows nothing about Parcel.

This asks Composer (InstalledVersions) where it put humbug/box for this copy of Parcel, and runs the vendor/bin/box beside it before trying anything else. It also adds composer-runtime-api to the requirements, since that's where InstalledVersions comes from. The lock file change is just the hash and Composer's metadata.

I found this while building an iOS app with Parcel 1.0.0 installed from Packagist into its own Composer home. The build failed as above. With this change copied into that install, the same build works and picks the right Box even with the other one first on the PATH. The new test fails without the change.

One behaviour change to watch: before, a project with its own vendor/bin/box got that Box first. That Box can't load Parcel's compactors unless the project also requires Parcel, and in that case it's the same Box anyway.

🤖 Generated with Claude Code

Box has to load Parcel's compactors, so it needs an autoloader with
Parcel in it. compile looked for Box in the project, then in Parcel's
own vendor/, then on the PATH. Parcel only has its own vendor/ in a
checkout. Installed from Packagist, Box sits next to it in the shared
vendor/, so compile fell through to whatever box was on the PATH and
failed with "The compactor class Parcel\Compactor\RealPathMod does not
exist" unless that happened to be the right one.

Ask Composer where it installed humbug/box for this copy of Parcel and
run the vendor/bin/box beside it first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit dd053f3 into main Nov 20, 2026
6 checks passed
@simonhamp
simonhamp deleted the box-path branch November 20, 2026 01:10
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