Repository navigation
Conversation
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
Contributor
|
Hey! Thanks for the PR. |
This branch has not been deployed
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.
Summary:
Addresses #54906.
When preparing the standalone React Native DevTools shell throws, the dev server prints:
This shows up, for example, on some Linux setups where the Electron binary fails to launch (see the
LaunchProcess: failed to execvpreports in the issue). As @huntie noted in the issue, this isn't fatal:/open-debuggerfalls 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:
unexpected_errorresult fromunstable_prepareDebuggerShellahumanReadableMessagesaying that a fallback is used, consistent with the messages for the other failure codes inLaunchUtils.js.unexpected_erroras a warning increateDevMiddleware, 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 ahumanReadableMessage.preparation failure loggingcase inStandaloneFuseboxShell-test.js: anunexpected_erroris logged vialogger.warn(notlogger.error) and includes the fallback message and the verbose details.Both new tests fail without the change and pass with it.