Reputation: 55
I have recently published an app on PlayStore and I had a problem with my React Native "android Only" version as follows:
The app would gives this error in both emulator and real android device and on a different IP other than my localhost as described in my /etc/hosts:
// Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner})
It would only open if I: 1- Run the debugger on "http://localhost:8081/debugger-ui" 2- run "react-native run-ios" 3- Enable "Debug JS Remotely".
I was advised that this problem would disappear on production, so I launched the app and the problem as follows:
App would install perfectly and when I launch the app I get the following error:
com.facebook.react.common.JavascriptException: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}).
"dependencies": { "firebase": "^5.8.4", "prop-types": "^15.7.2", "react": "16.6.3", "react-native": "0.58.5", "react-native-gesture-handler": "^1.0.16", "react-native-vector-icons": "^6.3.0", "react-navigation": "^3.3.0" },
React Native Environment Info: System: OS: macOS 10.14.3 CPU: (8) x64 Intel(R) Core(TM) i7-3635QM CPU @ 2.40GHz Memory: 44.27 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.10.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.8.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 28 Build Tools: 28.0.3 System Images: android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.5 => 0.58.5 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7
Any support is extremely appreciated.
Best Regards,
Upvotes: 1
Views: 903
Reputation: 3160
Probably you are not importing firebase in the correct way. Try to import firebase this way instead of how are you doing right now:
import firebase from '@firebase/app'
import '@firebase/auth'
Upvotes: 1