-
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
null is not an object (evaluating 'this._component.getScrollableNode') #10635
Comments
@janicduplessis - based on the comment that @jerson included above this is related to Animated, any idea of the cause? |
I'm getting a similar error
That line doesn't appear in my code base, it must be in react-native 0.36. |
This was added as part of native animated events PR |
I don't know how exactly refs work well enough so I'm not sure why it is null. This code gets called in both componentDidMount and componentWillUnmount. There are some null checks before accessing it in other code of the component so I guess it can be a reasonable fix to just add one there. |
I can see this (in 2 places)
So I guess this error means that |
yep |
@janicduplessis my hypothesis is that children get unmounted before the parent. What we should be doing then is in |
Is there a work around in the mean time? Or is it likely to be caused by me misusing the library in some way. |
@npomfret yeah,my error is the same as you ;my RN version is 0.35 |
Any thoughts on a work around? It's crashing my app completely. |
You could patch RN locally with null guards, it's not a good fix for the upstream codebase though. |
I still have this problem on RN 0.39. It's killing my app, but only of certain devices. Can't figure out why, but I don't know of a way to work around it. The view that it crashes on doesn't even have any animations on it. |
Is anyone able to reproduce the crash consitently? From the stacktrace in the redbox screenshot it looks like it happens in |
@gaearon Do you know if it's safe to use refs in |
I don't think it is safe. They are detached before an update and attached after it's flushed. |
Looking at it more this code doesn't really work properly because we need the new and the old ref. Using |
@gaearon Would that be safe in both stack and fiber or would I need to also add a null check on the ref in |
Can you create a minimal reproducing code for this? It’s hard for me to say without seeing what exactly you are running. You should be able to write this even against ReactDOM since reconciler works the same way. Does it happen sporadically or always? I would expect React to be consistent. |
I don't know exactly, I was mostly speculating based on the reports in this issue, I've never experienced this crash. I'll see if I can figure out a repro case. |
If someone that experience the crash could help figure out what causes this crash exactly it would also be great :) |
My app is suffering from this, but only when I deploy through iTunesConnect / TestFlight. So far I've not been able to reproduce in dev mode. And it doesn't happen consistently unfortunately. I've searched my codebase for both |
@npomfret You said earlier that the screen that crashed didn't have animations, are you using a navigation library? If so, which one? That could be where the crash is coming from. @ajithamp Looks like you got the crash in dev mode, are you able to reproduce it? If so could you show us an example that causes it? I tried reproducing this but wasn't able to, the ref seem fine in |
It would be unsafe if But this: return (
<Component
{...this._propsAnimated.__getValue()}
ref={this._setComponentRef}
/> looks safe to me too. |
Please ignore my comment about not having animations on the page. I can't accurately tell from the crash reports what pages the user is actually looking at. [EDIT] and I'm not using any navigation library other than what's in RN. Users claim that the crash happens without them doing anything, i.e. they open the app, wait for a bit and then it crashes. So no navigation. |
I also have this issue on this configuration: Was upgraded my RN fom 0.34 to 0.38.1 |
I'm getting this error as well, only occurs in release builds on android. Debug builds seem to work fine. Pretty stuck on this, it's blocking our release and I'm not sure where to proceed w/ debugging the root cause. My stacktrace looks like:
|
it happened to me yesterday,but I found in my project that caused by third party Component,I use 'jpush-react-native'and 'jcore-react-native' ,maybe the latest version is not suit for my project,so,my solution is remove them temporary |
If you use custom component as direct child of import React from 'react'
import { Image } from 'react-native'
const Icon = ({ glyph, ...props }) => (
<Image {...props} source={glyph} />
) Sometimes I was using it as direct child of <TouchableOpacity>
<Icon glyph={...} />
</TouchableOpacity> This causes the same error message as in this thread. After switching into class implementation everything works fine. import React, { PureComponent } from 'react'
import { Image } from 'react-native'
class Icon extends PureComponent {
render () {
const { glyph, ...props } = this.props
return (
<Image {...props} source={glyph} />
)
}
} |
Still exists.
EDIT: I have made a custom Card element, simple file nothing fancy (40 lines) and this error occurs when import it in some other JS file. Funny part is that It doesn't occur when importing but occurs when that component is used.
No error ^
error. I am not using any Animation. Edit 2: Solved it: how? I was doing Hope it helps someone. |
@zackify i think my issue is solvable by your approach. What is the file name of this file you are editing? Thanks again! |
@zackify I think it's todo with react-navigation 🤔 When I route from a tab navigator to a stack navigator, it throws this error. However I cannot confirm this. Any ideas? |
same issue . any solutions ? |
Same issue here. |
I had this same issue and found the culprit to be linked to a module The issue only arose after building for production. It was for both iOS and Android.
|
I had the same issue but my problem only happen when I called AsyncStorage and use on this way my friends @phil-andrews , @Unlighten , @Jiujiale , @jamesone , @zackify and @jerson My mistake was use AsyncStorage in this way
I fix change my AsyncStorage to:
|
…nctional Summary: Stateless functional components don't support refs and we need that for the component to work, it used to crash with this error message: `undefined is not an object (evaluating 'this._component.getScrollableNode')`. This makes it clear what the issue is. Fixes some of the errors in #10635, not sure if it fixes all the cases described in the issue though. **Test plan** Tested that passing a component with createClass or extends Component works but passing a function causes an error. [GENERAL] [ENHANCEMENT] [Animated] - Verify that the component passed to createAnimatedComponent is not functional Closes #15019 Differential Revision: D6988096 Pulled By: sahrens fbshipit-source-id: ec0ffa763245e786f44b4a1d56c0738876c25782
…nctional Summary: Stateless functional components don't support refs and we need that for the component to work, it used to crash with this error message: `undefined is not an object (evaluating 'this._component.getScrollableNode')`. This makes it clear what the issue is. Fixes some of the errors in facebook#10635, not sure if it fixes all the cases described in the issue though. **Test plan** Tested that passing a component with createClass or extends Component works but passing a function causes an error. [GENERAL] [ENHANCEMENT] [Animated] - Verify that the component passed to createAnimatedComponent is not functional Closes facebook#15019 Differential Revision: D6988096 Pulled By: sahrens fbshipit-source-id: ec0ffa763245e786f44b4a1d56c0738876c25782
It looks like 10b642a was an attempt to fix some of the crashes surfaced here. No one has commented on this issue since that fix landed, so I'll go ahead and close this. For anyone else landing here in the future, who believes they are encountering a related issue: please open a new bug report with all the relevant information for your situation. |
Description
http://crashes.to/s/280c411449d
Additional Information
The text was updated successfully, but these errors were encountered: