Hoisted workspace materializes the same React version twice when an earlier importer pins another version #1293
SummaryIn a two-importer workspace under This is not explained by incompatible peer ranges. Minimal graphPublic packages only:
Reprohttps://github.com/mwolson/tmp-aube-issues/tree/main/hoisted-react-peer-duplication git clone https://github.com/mwolson/tmp-aube-issues.git
cd tmp-aube-issues/hoisted-react-peer-duplication
./repro.shThe script exits 0 when web and zustand resolve to the same Direct commands: aube install --node-linker=isolated --ignore-scripts
# web and zustand both resolve to node_modules/.aube/react@19.2.6/... (same realpath)
aube install --node-linker=hoisted --ignore-scripts
# web -> packages/web/node_modules/react (19.2.6)
# zustand -> node_modules/zustand/node_modules/react (19.2.6)
# mobile -> node_modules/react (19.2.3)Aube 1.40.0 hoisted placementsFrom {
"react@19.2.3": ["node_modules/react"],
"react@19.2.6": [
"packages/web/node_modules/react",
"node_modules/zustand/node_modules/react"
],
"zustand@5.0.11(react@19.2.6)": ["node_modules/zustand"]
}
Native pnpm hoisted (
|
Replies: 2 comments
|
Confirmed — this is a bug in the workspace hoist winner selection. The linker let the first importer in path order claim the root name slot, while pnpm/Yarn prefer an explicit root dependency and otherwise rank versions by distinct dependents plus peer dependents. PR #1296 adds that preference pass and regression coverage: #1296 I also verified the public reproduction directly: AI-assisted — Tool: Codex; model: unavailable; version: unavailable. |
|
Confirmed fixed with aube |
Confirmed — this is a bug in the workspace hoist winner selection. The linker let the first importer in path order claim the root name slot, while pnpm/Yarn prefer an explicit root dependency and otherwise rank versions by distinct dependents plus peer dependents.
PR #1296 adds that preference pass and regression coverage: #1296
I also verified the public reproduction directly:
react@19.2.6now lands once at the workspace root, mobile keeps19.2.3locally, and web/zustand share both the React realpath and module export.AI-assisted — Tool: Codex; model: unavailable; version: unavailable.