From 06cd747d09c07cc63aeda87d19ce704cb0a794c7 Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Thu, 29 Jun 2023 14:37:16 +0300 Subject: [PATCH] fix(core): fix lockfile remapping for yarn berry with aliases --- packages/nx/src/plugins/js/lock-file/yarn-parser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nx/src/plugins/js/lock-file/yarn-parser.ts b/packages/nx/src/plugins/js/lock-file/yarn-parser.ts index dcad7f2b147b6..8a40ec649700c 100644 --- a/packages/nx/src/plugins/js/lock-file/yarn-parser.ts +++ b/packages/nx/src/plugins/js/lock-file/yarn-parser.ts @@ -348,7 +348,10 @@ function mapSnapshots( .slice(0, key.indexOf('#')) .replace(`@patch:${packageName}@`, '@npm:'); } - if (!existingKeys.get(packageName).has(normalizedKey)) { + if ( + !existingKeys.get(packageName) || + !existingKeys.get(packageName).has(normalizedKey) + ) { keysSet.delete(key); } }