From a1d7d2f0f34e4b2edc7aec063dc55038bc0f1fdf Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Wed, 14 Dec 2022 11:58:36 -0500 Subject: [PATCH] fix(devkit): do not move properties when nx.json doesn't exist --- packages/devkit/src/generators/format-files.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/devkit/src/generators/format-files.ts b/packages/devkit/src/generators/format-files.ts index bcc2a3d89c79e..b60146c9621b3 100644 --- a/packages/devkit/src/generators/format-files.ts +++ b/packages/devkit/src/generators/format-files.ts @@ -95,6 +95,11 @@ function sortWorkspaceJson(tree: Tree) { * correctly. */ function ensurePropertiesAreInNewLocations(tree: Tree) { + // If nx.json doesn't exist then there is no where to move these properties to + if (!tree.exists('nx.json')) { + return; + } + const workspacePath = getWorkspacePath(tree); if (!workspacePath) { return;