From d96ebb690711c1d118f9c0ef82284d0d458b4416 Mon Sep 17 00:00:00 2001 From: Emily Xiong Date: Sat, 2 Nov 2024 00:48:56 -0400 Subject: [PATCH] fix(core): fix cannot read properties of undefined (reading 'split') --- .../src/project-graph/utils/project-configuration-utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nx/src/project-graph/utils/project-configuration-utils.ts b/packages/nx/src/project-graph/utils/project-configuration-utils.ts index 291e8fe93c1ef..56cbb493eea4f 100644 --- a/packages/nx/src/project-graph/utils/project-configuration-utils.ts +++ b/packages/nx/src/project-graph/utils/project-configuration-utils.ts @@ -372,8 +372,10 @@ export async function createProjectConfigurations( } else { errorBodyLines.push(` - ${e.message}`); } - const innerStackTrace = ' ' + e.stack.split('\n').join('\n '); - errorBodyLines.push(innerStackTrace); + if (e.stack) { + const innerStackTrace = ' ' + e.stack.split('\n')?.join('\n '); + errorBodyLines.push(innerStackTrace); + } } error.stack = errorBodyLines.join('\n');