Repository navigation
Hidden hoist picks a different version than pnpm when a package has two versions in the graph #1811
When the graph has two versions of a package, aube and pnpm put different versions into the hidden hoist directory, even when aube installs from the lockfile pnpm wrote. An undeclared import from inside the virtual store then gets a different version under aube.
{
"name": "hidden-hoist-version-choice",
"private": true,
"dependencies": {
"is-even": "1.0.0",
"is-odd": "3.0.1"
}
}The graph has two
PNPM_BIN=/path/to/real/pnpm ./repro.shpnpm 11.10.0 gives the same result. aube gives the same result with Why they differ pnpm's The same loop also hidden-hoists the root's direct dependencies. In this fixture, Real-world impact Found in pingdotgg/t3code (pnpm 12 lockfile, One test fails outright, because 1.0.0-rc.17 lacks a subpath export that 1.2.5 has: The rest of the build runs on the older rolldown without an error, which is harder to notice. We moved that tree back to pnpm because of this. The undeclared import is the package's own bug, but the hidden hoist exists to absorb exactly that, and projects moving from pnpm count on it picking the same version. I didn't find a rule for which version wins in the |
Replies: 3 comments
|
Thanks for the thorough write-up and the t3code example. #1815 changes the hidden hoist to match pnpm's order: the shallowest version from the importers wins (ties go to the dep path that sorts first), and the root's direct dependencies are no longer hidden-hoisted. On your repro, Known gap: pnpm breaks same-depth ties by parent node id, aube by the package's own dep path, so two versions at the same depth can still differ. I checked against the pnpm output in your report, not a real pnpm binary. AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable. |
|
Implemented in #1815: fix(linker): hidden-hoist shallowest version first like pnpm |
|
Retested with
PNPM_BIN=/path/to/real/pnpm ./repro.shIt now exits 0 with native pnpm 12.14.0 as the control. Fix shipped in aube 2.8.2 via #1815. Marking your reply as the answer. |
Thanks for the thorough write-up and the t3code example. #1815 changes the hidden hoist to match pnpm's order: the shallowest version from the importers wins (ties go to the dep path that sorts first), and the root's direct dependencies are no longer hidden-hoisted. On your repro,
is-numbernow hoists 6.0.0 andis-oddstays out of the hidden hoist.Known gap: pnpm breaks same-depth ties by parent node id, aube by the package's own dep path, so two versions at the same depth can still differ. I checked against the pnpm output in your report, not a real pnpm binary.
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.