Skip to content

Clarify non-fatal React Native DevTools preparation errors - #58892

Open
Cedric921 wants to merge 1 commit into
react:mainfrom
Cedric921:fix/devtools-preparation-error-message
Open

Cedric921 wants to merge 1 commit into
react:mainfrom
Cedric921:fix/devtools-preparation-error-message

Conversation

@Cedric921

Copy link
Copy Markdown

Summary:

Addresses #54906.

When preparing the standalone React Native DevTools shell throws, the dev server prints:

ERROR  An unknown error occurred while installing React Native DevTools.. Details:

This shows up, for example, on some Linux setups where the Electron binary fails to launch (see the LaunchProcess: failed to execvp reports in the issue). As @huntie noted in the issue, this isn't fatal: /open-debugger falls back to opening the debugger in a browser window. The message reads like a hard failure, though, and it also ends with a doubled period.

This PR:

  • Gives the catch-all unexpected_error result from unstable_prepareDebuggerShell a humanReadableMessage saying that a fallback is used, consistent with the messages for the other failure codes in LaunchUtils.js.
  • Logs unexpected_error as a warning in createDevMiddleware, like the other non-fatal codes (likely_offline, platform_not_supported, possible_corruption), and removes the duplicated trailing period.

It does not address the underlying Linux launch failure (the binary path containing spaces). That fix belongs in the prebuilt DevTools packaging.

Changelog:

[GENERAL] [CHANGED] - Report unexpected React Native DevTools preparation failures as a non-fatal warning that mentions the fallback

Test Plan:

Added:

  • packages/debugger-shell/src/node/__tests__/prepareDebuggerShell-test.js: the catch-all path returns a humanReadableMessage.
  • A preparation failure logging case in StandaloneFuseboxShell-test.js: an unexpected_error is logged via logger.warn (not logger.error) and includes the fallback message and the verbose details.

Both new tests fail without the change and pass with it.

yarn jest packages/dev-middleware packages/debugger-shell
Tests:       146 passed, 146 total

yarn flow full-check   -> Found 0 errors
yarn eslint            -> clean
yarn prettier --check  -> clean for changed files

When preparing the standalone React Native DevTools shell throws (e.g. the
Electron binary fails to launch on some Linux setups), the dev server logged
"An unknown error occurred while installing React Native DevTools.." as an
error. This is not fatal: /open-debugger falls back to a browser window.

- Give the catch-all unexpected_error result a humanReadableMessage that says
  a fallback is used, consistent with the other failure codes.
- Log unexpected_error as a warning, like the other non-fatal failure codes,
  and drop the duplicated trailing period.

Addresses react#54906
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 6, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 6, 2026
@vzaidman

vzaidman commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Hey! Thanks for the PR.
I think that unexpected errors ARE fatal and should log an error. However this one should indeed log a warning, so it probably should not be unexpected_error. See if there's an existing error we can throw in this case, and if not- create a new one.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants