Skip to content

Commit 06fb3d8

Browse files
committed
fix: peer edge crash due to no parent or detached node
1 parent 7f66f0a commit 06fb3d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

workspaces/arborist/lib/arborist/build-ideal-tree.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ This is a one-time fix-up, please be patient...
12991299
// virtual root is based on the root project, and allow non-peer parent
13001300
// deps to override, but throw if no preference can be determined.
13011301
async #loadPeerSet (node, required) {
1302+
const parent = node.parent
13021303
const peerEdges = [...node.edgesOut.values()]
13031304
// we typically only install non-optional peers, but we have to
13041305
// factor them into the peerSet so that we can avoid conflicts
@@ -1311,8 +1312,8 @@ This is a one-time fix-up, please be patient...
13111312
continue
13121313
}
13131314

1314-
const parentEdge = node.parent.edgesOut.get(edge.name)
1315-
const { isProjectRoot, isWorkspace } = node.parent.sourceReference
1315+
const parentEdge = parent.edgesOut.get(edge.name)
1316+
const { isProjectRoot, isWorkspace } = parent.sourceReference
13161317
const isMine = isProjectRoot || isWorkspace
13171318
const conflictOK = this.options.force || !isMine && !this.#strictPeerDeps
13181319

0 commit comments

Comments
 (0)