Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): try to resolve Cannot read properties of undefined (reading 'includes') error #4675

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

dsinghvi
Copy link
Member

@dsinghvi dsinghvi commented Sep 17, 2024

This PR introduces a fix to the rerunFernCliAtVersion function in the rerunFernCliAtVersion.ts file. The fix addresses an issue where the function fails to check for optionality when parsing stdout and stderr in the CLI, leading to an error: Cannot read properties of undefined (reading 'includes').

Changes:

  • The if statement in the rerunFernCliAtVersion function now uses optional chaining (stdout?.includes) to check for the presence of the string "code EEXIST" in stdout or stderr.
  • The changelogEntry in the versions.yml file has been updated to reflect the fix, with a summary describing the issue and the type set to "fix".

@@ -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")) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels like the only recent additions to the CLI that use includes

@dsinghvi dsinghvi merged commit 40c799a into main Sep 17, 2024
47 checks passed
@dsinghvi dsinghvi deleted the dsinghvi/try-to-resolve-includes-err branch September 17, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant