From 354d882a2e7a4e9209f9ff6af4ee18342f57983a Mon Sep 17 00:00:00 2001 From: Frank van Puffelen Date: Thu, 12 Nov 2015 18:06:22 -0800 Subject: [PATCH 1/2] Added section on modules that require WebSocket Explain how to troubleshoot 'No transports available' error that appears when you require firebase before react-native. --- docs/Troubleshooting.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index ec07143da..9efad184e 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -93,3 +93,15 @@ Ensure that you are on the same WiFi network as your computer. If you're using a ##### Android You need to run `adb reverse tcp:8081 tcp:8081` to forward requests from the device to your computer. This works only on Android 5.0 and newer. + +#### Module that uses `WebSocket` throws exception + +React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through `require('react-native')`. If you load another module that requires WebSockets, be sure to load/require is after react-native. + +So: +``` +var React = require('react-native'); +var Firebase = require('firebase'); +``` + +In the case of Firebase requiring firebase *before* react-native will result in a: 'No transports available' redscreen. From 591a2284cfefd269dc40f6306fc23ad0c95f2b4d Mon Sep 17 00:00:00 2001 From: Frank van Puffelen Date: Thu, 12 Nov 2015 18:56:06 -0800 Subject: [PATCH 2/2] Fixed two typos --- docs/Troubleshooting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index 9efad184e..5b1f5f1b3 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -96,7 +96,7 @@ You need to run `adb reverse tcp:8081 tcp:8081` to forward requests from the dev #### Module that uses `WebSocket` throws exception -React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through `require('react-native')`. If you load another module that requires WebSockets, be sure to load/require is after react-native. +React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through `require('react-native')`. If you load another module that requires WebSockets, be sure to load/require it after react-native. So: ``` @@ -104,4 +104,4 @@ var React = require('react-native'); var Firebase = require('firebase'); ``` -In the case of Firebase requiring firebase *before* react-native will result in a: 'No transports available' redscreen. +In the case of Firebase requiring firebase *before* react-native will result in a: 'No transports available' redbox.