Skip to content

Commit d554506

Browse files
throw error before cleanup (#2293)
1 parent 28a199e commit d554506

File tree

1 file changed

+7
-4
lines changed
  • packages/installer/src/dappGet/aggregate

1 file changed

+7
-4
lines changed

packages/installer/src/dappGet/aggregate/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,17 @@ export default async function aggregate({
8282
dappGetFetcher // #### Injected dependency
8383
});
8484

85+
// Clean up the dnps graph only once after all aggregation is done
86+
// IMPORTANT: This must be done right after all dependencies are aggregated
87+
cleanupDnps(dnps);
88+
8589
// If no resolvable packages or dependencies were found, throw an error
8690
if (Object.keys(dnps).length === 0) {
87-
throw new Error(`A dependency of the requested package "${req.name}" (version range: "${req.ver}") could not be resolved`);
91+
throw new Error(
92+
`A dependency of the requested package "${req.name}" (version range: "${req.ver}") could not be resolved`
93+
);
8894
}
8995

90-
// Clean up the dnps graph only once after all aggregation is done
91-
cleanupDnps(dnps);
92-
9396
const relevantInstalledDnps = getRelevantInstalledDnps({
9497
// requestedDnps = ["A", "B", "C"]
9598
requestedDnps: Object.keys(dnps),

0 commit comments

Comments
 (0)