-
Notifications
You must be signed in to change notification settings - Fork 24.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing Poly (babel-polyfill,core.js symbol,es6-symbol) Crashes app on load - Objects are not valid as React child #18542
Comments
Why are you writing
Instead of
|
@kelset sorry the code that looked like html tags was disappearing even with a pre tag and I did a quick hack just to get it to display. I see now that you use |
Does it mean that now it works for you? If so, can you please close the issue? |
@kelset NO it does not work the funny code was github issue tracker giving me issues displaying code in comments the funny code has nothing to do with the actual error. |
Edited the original comment to clear up any confusion. |
Moving |
@ronhe, moving it to the top of the file did not work for me, unfortunately :-( |
By the way, this was working for me up until react-native 0.55.4. With rn-0.56.0, I see this problem. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
I have the same issue since I migrated to RN 0.57. Adding Why adding this import is solving this error? |
@zedtux OMG thanks so much !!! After spending at least two days debugging my application to the latest RN version, you safed me with that code! I was suspecting react-native-firebase because of this issue looking close enough: invertase/react-native-firebase#1438 Adding While "debugging" the app it works like a charm, which even got mentioned in a different project: realm/realm-js#1883 even there an JSC-upgrade was mentioned. |
@zedtux : This solution gives me an error as follows : Unable to resolve module
Error: Unable to resolve module
FAILURE: Build failed with an exception.
BUILD FAILED in 19s |
@sayali181290 what RN version are you using? |
0.57 |
I'm using this version too, it should come from one of your dependencies. Can you please post your |
Yes. Sure. { |
Please share if anyone having any solution for this |
@sayali181290 instead of adding polyfills, and as this is android-specific, I went over to add the JSC-android I mentioned above:
yarn add --dev jsc-android
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// for replacing the older JavaScriptCore which is bundled with RN (they use r174650)
maven {
// Local Maven repo containing AARs with JSC library built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
}
}
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'android-jsc') {
details.useTarget group: details.requested.group, name: 'android-jsc-intl', version: 'r225067'
}
}
}
} Note on step 3: you should make sure that the version matches the folder below Note in general: this is a workaround and replaces the used JavaScriptCore which comes with RN itself. It will increase your filesyse of the created APK-files (like mentioned on the android-jsc project) |
@FibreFoX I tried the above solution but not working |
@ManishAhire Did you remove the import of |
I'm not sure why, or if it's better than just adding all of
|
It seems like there are enough workarounds for this to consider the issue resolved. |
@cpojer so instead of fixing a hole in the wall, you just say, we shouldn't look there? As this is an issue with the bundled polyfills required due to some older JSC, maybe with upcoming releases of the new JSC this issue gets resolved (which are getting into RN with 0.59 maybe?). Can we please re-open this issue until it gets verified to work with the new JSC, or with adjusted polyfills? |
React Native is not shipping with a Symbol polyfill right now and we aren't going to. You are right, with a new version of JSC the Symbol polyfill will be available and this problem should go away. It will be in the next version. |
any news on this issue? it has been blocking me from upgrading |
I fixed this issue by updating core-js to the latest stable and changing my polyfills.ts to this.
|
There might be something to learn from this issue even if it is not the same maybe its a similar loading issue?
#15182
I tried to use Symbol in my local project but none of the poly's I found work they all crash RN when I try to run even the simplest app with Objects are not valid as React child
reconcileChIldFibers throws InvalidObjectType line 8348:31 (ReactNativeRenderer - dev.js)
Environment
Environment:
OS: Linux 4.15
Node: 8.10.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.3
react-native: 0.54.2 => 0.54.2
Steps to Reproduce
react-native init rnsymboleish
cd rnsymboleish
npm install --save babel-polyfill (or npm install --save es6-symbol)
npm install
---App.js
react-native run-android
Expected Behavior
Thought it would not crash...?
Actual Behavior
3-24 19:14:45.728 30769 31013 I ReactNativeJS: Running application "rnsymbolwtf" with appParams: {"rootTag":1}. DEV === true, development-level warning are ON, performance optimizations are OFF
03-24 19:14:45.748 30769 31013 E ReactNativeJS: Invariant Violation: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead.
03-24 19:14:45.748 30769 31013 E ReactNativeJS:
03-24 19:14:45.748 30769 31013 E ReactNativeJS: This error is located at:
03-24 19:14:45.818 30769 31013 E ReactNativeJS: Invariant Violation: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead.
03-24 19:14:45.818 30769 31013 E ReactNativeJS:
03-24 19:14:45.818 30769 31013 E ReactNativeJS: This error is located at:
The text was updated successfully, but these errors were encountered: