From b93a87d9fdfb453b904ed70203e71d41408a9d8c 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 bcc2a3d89c79eb..b60146c9621b33 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;