Skip to content

Commit 1ac3dab

Browse files
huntiefacebook-github-bot
authored andcommitted
Improve "Open Debugger" error guidance (#39521)
Summary: Pull Request resolved: #39521 Minor Dev Menu changes: - Improve guidance when failing to connect to the debugger. - Align "Show Element Inspector" wording on iOS. Changelog: [Internal] Reviewed By: blakef Differential Revision: D49375789 fbshipit-source-id: 092da6cae1a62a1bcc4dc877ab01369db6876741
1 parent 77df5a9 commit 1ac3dab

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

packages/react-native/React/CoreModules/RCTDevMenu.mm

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,26 @@ - (void)setDefaultJSBundle
261261
#if RCT_ENABLE_INSPECTOR
262262
if (devSettings.isDeviceDebuggingAvailable) {
263263
// On-device JS debugging (CDP). Render action to open debugger frontend.
264-
[items addObject:[RCTDevMenuItem
265-
buttonItemWithTitleBlock:^NSString * {
266-
return @"Open Debugger";
267-
}
268-
handler:^{
269-
[RCTInspectorDevServerHelper
270-
openDebugger:bundleManager.bundleURL
271-
withErrorMessage:
272-
@"Failed to open debugger. Please check that the dev server is running."];
273-
}]];
264+
[items
265+
addObject:
266+
[RCTDevMenuItem
267+
buttonItemWithTitleBlock:^NSString * {
268+
return @"Open Debugger";
269+
}
270+
handler:^{
271+
[RCTInspectorDevServerHelper
272+
openDebugger:bundleManager.bundleURL
273+
withErrorMessage:
274+
@"Failed to open debugger. Please check that the dev server is running and reload the app."];
275+
}]];
274276
}
275277
#endif
276278
}
277279

278280
[items addObject:[RCTDevMenuItem
279281
buttonItemWithTitleBlock:^NSString * {
280-
return devSettings.isElementInspectorShown ? @"Hide Inspector" : @"Show Inspector";
282+
return devSettings.isElementInspectorShown ? @"Hide Element Inspector"
283+
: @"Show Element Inspector";
281284
}
282285
handler:^{
283286
[devSettings toggleElementInspector];

packages/react-native/ReactAndroid/src/main/res/devsupport/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<string name="catalyst_reload" project="catalyst" translatable="false">Reload</string>
44
<string name="catalyst_reload_error" project="catalyst" translatable="false">Failed to load bundle. Try restarting the bundler or reconnecting your device.</string>
55
<string name="catalyst_change_bundle_location" project="catalyst" translatable="false">Change Bundle Location</string>
6-
<string name="catalyst_open_debugger_error" project="catalyst" translatable="false">Failed to open debugger. Please check that the dev server is running.</string>
6+
<string name="catalyst_open_debugger_error" project="catalyst" translatable="false">Failed to open debugger. Please check that the dev server is running and reload the app.</string>
77
<string name="catalyst_debug_open" project="catalyst" translatable="false">Open Debugger</string>
88
<string name="catalyst_debug_connecting" project="catalyst" translatable="false">Connecting to debugger...</string>
99
<string name="catalyst_debug_error" project="catalyst" translatable="false">Failed to connect to debugger!</string>

0 commit comments

Comments
 (0)