From 40c799a191fb1b31d35bee4f4fd7f48f9b9a037d Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Tue, 17 Sep 2024 19:28:16 -0400 Subject: [PATCH] fix(cli): try to resolve `Cannot read properties of undefined (reading 'includes')` error (#4675) --- packages/cli/cli/src/rerunFernCliAtVersion.ts | 2 +- packages/cli/cli/versions.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/cli/cli/src/rerunFernCliAtVersion.ts b/packages/cli/cli/src/rerunFernCliAtVersion.ts index d5de632c9ec..80f77fdb4e0 100644 --- a/packages/cli/cli/src/rerunFernCliAtVersion.ts +++ b/packages/cli/cli/src/rerunFernCliAtVersion.ts @@ -35,7 +35,7 @@ export async function rerunFernCliAtVersion({ [FERN_CWD_ENV_VAR]: process.env[FERN_CWD_ENV_VAR] ?? process.cwd() } }); - if (stdout.includes("code EEXIST") || stderr.includes("code EEXIST")) { + if (stdout?.includes("code EEXIST") || stderr?.includes("code EEXIST")) { // try again if there is a npx conflict return await rerunFernCliAtVersion({ version, diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index b0ca6772879..7c80c0c0805 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,11 @@ +- changelogEntry: + - summary: | + Make sure to check for optionality when parsing stdout and stderr in CLI. This + removes the error: `Cannot read properties of undefined (reading 'includes')`. + type: fix + irVersion: 53 + version: 0.42.1 + - changelogEntry: - summary: | If you merge multiple OpenAPI specs with namespaces, `fern check` will no longer