Skip to content

Commit bc634ea

Browse files
codeheroicsFacebook Github Bot 0
authored andcommitted
More helpful error message when react-native start is forgotten
Summary: Developing with react-native on Linux, I found myself facing this message: ![chpao3jwuaehr_p jpg large](https://cloud.githubusercontent.com/assets/1598317/15032665/ae90ee88-1263-11e6-9acd-3fe261c08c28.jpeg) The problem is actually quite simple: I hadn't used `react-native start` before starting `react-native run-android`, which caused this error, both on an emulator and a real Android device. As the message is currently unhelpful, but can be shown because of a simple mistake, I updated it. ~~Additionally, I clarified the fact that `react-native start` is still necessary on Linux, updating a title on the Linux and Windows Support documentation page.~~ Closes #7396 Differential Revision: D3305078 fbshipit-source-id: 2d87e02ff2ad15d8239fbcc0ada4a4e67b982e94
1 parent 0aea74e commit bc634ea

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ReactAndroid/src/main/jni/react/JSCExecutor.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,12 @@ void JSCExecutor::flush() {
277277

278278
if (!ensureBatchedBridgeObject()) {
279279
throwJSExecutionException(
280-
"Couldn't get the native call queue: bridge configuration isn't available. This "
281-
"probably indicates there was an issue loading the JS bundle, e.g. it wasn't packaged "
282-
"into the app or was malformed. Check your logs (`adb logcat`) for more information.");
280+
"Could not connect to development server.\n"
281+
"Try the following to fix the issue:\n"
282+
"Ensure that the packager server is running\n"
283+
"Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices\n"
284+
"If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device\n"
285+
"If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081");
283286
}
284287

285288
std::string calls = m_flushedQueueObj->callAsFunction().toJSONString();

0 commit comments

Comments
 (0)