-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'this._subscribableSubscriptions.forEach') #17348
Comments
@facebook-github-bot no-template |
I fixed it by evaluating variable Changing this:
To this:
|
Hey @a3diti, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks! |
@facebook-github-bot reopen please. It's the same issue for me. No addition information. Just started to throw this error today without any changes. Related to ScrollView. It appears on any View containing ScrollView inside like FlatList. |
React Native version 0.50.3 is affected too |
I also have this issue. RN 0.51.0, running a release build on Android 7. |
I'm seeing the exact same issue. Looks like |
Same issue for me. No code changes. It suddenly fails. RN 0.50.4 |
@a3diti I Could kiss you! |
Getting this error too, on a new test app, created with [email protected], which used react-native 0.51.0 and react 16.0.0. Also using react-navigation and native-base. @a3diti 's code change to the |
same issue for me. debug build works fine, but fail in release build. RN 0.51.0 |
I have this error when building APK via Expo. RN 0.51.0 |
Same Issue. Changing line 33 in
worked for me! Thankyou! |
If that workaround is working for people, anybody mind making a PR against RN itself so that this problem is fixed for everyone? |
I am closing the issue I created today for this one. Here is what I contributed on it. Is this a bug report?Yes Have you read the Contributing Guidelines?Yes EnvironmentEnvironment: Packages: (wanted => installed) Steps to Reproduce
Expected BehaviorI expected that the release version would work as the debug version did. Actual BehaviorSigned apk crashes when any screen which has any version of ScrollView in it's render. The problem is this: Here is where the error occurs: in Subscribable.js This is the original code.
Here is where i removed the failing call. I have confirmed that this._subscribableSubscriptions returns a null and crashes when the forEach() is called.
Following removing the offending code, the app no longer crashes on startup. FROM LOGCAT:
Reproducible DemoBecause the app crashes on a production build here is a simple App.js file. This demo can be reproduced by:
NOTE: but probably not important. When I build my app (either my own app or the test app), I must run gradlew assembleRelease twice, it always fails the first time. I think it needs to reset the transform cache. ADDITIONAL NOTE: From what the other person who has seen this said, when reducing the version of React-native to 49.5 the problem goes away.
|
made a PR #17359 for react-native folks. I'm actually having the same issue here: https://github.com/facebookarchive/react-native-custom-components/blob/master/src/Subscribable.js (exact same file as here). |
The issue is caused by the [email protected],back to 3.2.2 |
@ohflying how did you find the fact of being caused by uglify-es ? |
@a3diti Adding a resolution is a temporary work-around and not a fix. I expect many people will run into this issue. I also expect few will be smart or lucky enough to determine the root cause. Closing this issue make it less likely a possible work-around will be found. The only thing that has worked for me was your advice to change the Subscribers.js code. Changing this:
To this:
|
@esutton Ok, i guess you have a different environment since the I recommend some necessary actions to perform when installing
When i test the app for release, on Xcode i go to "Edit Scheme">Run>Build Configuration>Release If those solutions don't work for you, try to initiate a new project on another folder and edit |
So I updated all of the dependencies in my package.json, removed node_modules AND the package-lock.json and did a clean/rebuild in release mode and that worked. I'm not sure if it was the package-lock or that the dependencies weren't all on the most up-to-date level, but that fixed it. |
@a3diti Shouldn't this be fixed in react-native and * * NOT * * as a manually added resolution in a developer's project's package.json? Concerns:
Work-Around:I confirmed the uglify-es resolution work-around works on both Android and iOS release builds.
Build and run:
|
+1 |
I expect * many * release build apps have suddenly started crashing due to this minification bug. I randomly ran across this victory-native issue that sounds like the root cause may be the same as this #17348 issue: |
Fixes facebook#17348 - Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'this._subscribableSubscriptions.forEach')
This comment #17348 (comment) fixed it for me. Thanks @a3diti ! I've submitted a PR (#17463) with this fix. Hopefully it gets merged soon. |
Upgrade to RN0.52 works for me |
|
@sonaye thanks! I'm using expo 24 and your comment worked for me. I had to do both your steps. has anyone posted an issue on |
Forcing |
Solved with uglify-es 3.3.4 (steps: delete uglify-es from node_modules, put in your package.json "uglify-es": 3.3.4 and finally install with npm i). Tnks @a3diti |
|
We can resolve the issue by checking this._subscribableSubscriptions on line 33 on react native file project/node_modules/react-native/Libraries/Components/Subscribable.js - line 33 (-)this._subscribableSubscriptions.forEach |
Running into same issue only on release not debug. |
Nothing works for me, tried all fixes mentioned above but app still crashes when scrolling inside a scrollview on Android Real Device (Samsung) |
For me the problem was that the function is called inside the wrong object. Replacing onPress={this.someFunction} with onPress={() => {this.someFunction()} did the trick. |
This fixes the RN issues @ facebook/react-native#17348
When changing scheme to Release in able to run the app on the device, it triggered an error
This crashed the application.
I searched for the error code and found it:
project/node_modules/react-native/Libraries/Components/Subscribable.js
on line 33 with RN 0.51.0The text was updated successfully, but these errors were encountered: