From 70492f3939cfab6eae48fcb62f98eecfc9eed117 Mon Sep 17 00:00:00 2001 From: Jay Bell Date: Mon, 28 Mar 2022 13:50:45 -0700 Subject: [PATCH] fix(core): add more descriptive dependencies build error (#9031) Co-authored-by: Craigory Coppola --- .../workspace/src/utilities/buildable-libs-utils.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/workspace/src/utilities/buildable-libs-utils.ts b/packages/workspace/src/utilities/buildable-libs-utils.ts index 13df071766199..cd386be7721ae 100644 --- a/packages/workspace/src/utilities/buildable-libs-utils.ts +++ b/packages/workspace/src/utilities/buildable-libs-utils.ts @@ -208,7 +208,15 @@ export function checkDependentProjectsHaveBeenBuilt( targetName, projectDependencies ); - if (missing.length > 0) { + if (missing.length === projectDependencies.length && missing.length > 0) { + console.error(stripIndents` + It looks like all of ${projectName}'s dependencies have not been built yet: + ${missing.map((x) => ` - ${x.node.name}`).join('\n')} + + You might be missing a "targetDependencies" configuration in your root nx.json (https://nx.dev/configuration/packagejson#target-dependencies), + or "dependsOn" configured in ${projectName}'s angular.json/workspace.json record or project.json (https://nx.dev/configuration/packagejson#dependson) + `); + } else if (missing.length > 0) { console.error(stripIndents` Some of the project ${projectName}'s dependencies have not been built yet. Please build these libraries before: ${missing.map((x) => ` - ${x.node.name}`).join('\n')}