[eas-cli] Fix invalid json for eas update with --json flag#3659
Merged
douglowder merged 2 commits intoexpo:mainfrom Apr 30, 2026
Merged
[eas-cli] Fix invalid json for eas update with --json flag#3659douglowder merged 2 commits intoexpo:mainfrom
douglowder merged 2 commits intoexpo:mainfrom
Conversation
|
Subscribed to pull request
Generated by CodeMention |
douglowder
approved these changes
Apr 30, 2026
Contributor
|
Looks good, please add a changelog entry in CHANGELOG.md |
…ithoutLoggingAsync @expo/fingerprint spawns subprocesses concurrently (autolinking, react-native config, ExpoConfigLoader) that can write to stdout, corrupting the parent process's output when --json is in use. The silent option exists specifically to suppress this, but was never set. The function is already named WithoutLogging so this is the correct default regardless of --json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20ce5fe to
3b47edd
Compare
Contributor
Author
|
@douglowder Rebased onto latest main to avoid conflicts in changelog and added new entry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@expo/fingerprint spawns subprocesses concurrently (autolinking, react-native config, ExpoConfigLoader) that can write to stdout, corrupting the parent process's output when --json is in use. The silent option exists specifically to suppress this, but was never set. The function is already named WithoutLogging so this is the correct default regardless of --json.
Why
We get this output often when running eas update with --json and --emit-metadata. The actual json conflict changes and flakes across update runs.
Wha'ts going on
1. `--json` monkey-patches `process.stdout`
eas-cli/src/utils/json.ts#L11-L12— when `--json` is passed, eas-cli redirects `process.stdout.write → process.stderr.write` so progress logs don't pollute the final JSON output.2. `@expo/fingerprint` spawns 5–6 subprocesses concurrently
@expo/fingerprint/src/sourcer/Sourcer.ts#L44-L79— fingerprinting runs `getExpoAutolinkingAndroid`, `getExpoAutolinkingIos`, `getCoreAutolinkingFromExpoAndroid`, `getCoreAutolinkingFromExpoIos`, `getCoreAutolinkingFromRncCli`, and `getExpoConfig` all via `Promise.all()`. Each spawns a separate OS process.3. Subprocess stdout is not subject to the in-process redirect
These are separate OS processes — the `process.stdout.write` monkey-patch in the parent has no effect on them. Any stray `console.log` from those subprocesses gets captured and `JSON.parse()`d by the parent.
4. There is a known IPC fallback that writes directly to stdout
@expo/fingerprint/src/ExpoConfigLoader.ts#L43-L46— if `process.send` (IPC) is unavailable, `ExpoConfigLoader` falls back to `console.log(result)`, writing a multi-KB JSON blob directly to stdout, which then contaminates the parent's JSON stream.5. The fix exists in `@expo/fingerprint` but eas-cli never uses it
eas-cli/src/fingerprint/cli.ts#L89-L108— `@expo/fingerprint` has a `silent: true` option specifically to suppress subprocess stdout pollution in JSON contexts, but `createFingerprintWithoutLoggingAsync` never sets it.How
Suppress output from fingerprinting by suppressing output
Test Plan
Repeatedly run
eas update --branch staging --message "message" --emit-metadata --json --non-interactiveand watch for intermitent failures on fingerprinting fail due to invalid JSON. If it always works and doesn't flake good to go.