fix(core): provide more info for "findOriginalKeys is not a function" errors (#16883)
This commit is contained in:
parent
e481cd5461
commit
d26f26a98b
@ -285,7 +285,13 @@ function mapSnapshots(
|
|||||||
|
|
||||||
// collect snapshots and their matching keys
|
// collect snapshots and their matching keys
|
||||||
Object.values(nodes).forEach((node) => {
|
Object.values(nodes).forEach((node) => {
|
||||||
const [matchedKeys, snapshot] = findOriginalKeys(groupedDependencies, node);
|
const foundOriginalKeys = findOriginalKeys(groupedDependencies, node);
|
||||||
|
if (!foundOriginalKeys) {
|
||||||
|
throw new Error(
|
||||||
|
`Original key(s) not found for "${node.data.packageName}@${node.data.version}" while pruning yarn.lock.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const [matchedKeys, snapshot] = foundOriginalKeys;
|
||||||
snapshotMap.set(snapshot, new Set(matchedKeys));
|
snapshotMap.set(snapshot, new Set(matchedKeys));
|
||||||
|
|
||||||
// separately save keys that still exist
|
// separately save keys that still exist
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user