Skip to content
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

Invariant Violation : Unable to find node on an unmounted component. #23790

Closed
lc3t35 opened this issue Mar 6, 2019 · 5 comments
Closed

Invariant Violation : Unable to find node on an unmounted component. #23790

lc3t35 opened this issue Mar 6, 2019 · 5 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@lc3t35
Copy link

lc3t35 commented Mar 6, 2019

🐛 Bug Report

App crashes with "Invariant Violation : Unable to find node on an unmounted component." error message

Invariant Violation: Unable to find node on an unmounted component.
  at invariant(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:33:19)
  at findCurrentFiberUsingSlowPath(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:1232:7)
  at findCurrentHostFiber(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:1283:12)
  at findHostInstance$1(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:5769:15)
  at findNodeHandle(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:5830:23)
  at measureLayoutRelativeToContainingList(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Lists/VirtualizedList.js:1117:19)
  at apply(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Lists/VirtualizedList.js:1101:25)
  at invokeGuardedCallbackImpl(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:47:10)
  at invokeGuardedCallback(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:65:29)
  at invokeGuardedCallbackAndCatchFirstError(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:78:25)
  at executeDispatch(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:172:3)
  at executeDispatchesAndReleaseTopLevel(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:221:9)
  at forEachAccumulated(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:205:59)
  at fn(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:1065:8)
  at _batchedUpdatesImpl(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:5841:12)
  at batchedUpdates(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:1026:12)
  at _receiveRootNodeIDEvent(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:1046:3)
  at apply(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js:1083:5)
  at __callFunction(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:349:42)
  at fn(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:106:12)
  at __guard(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:297:9)
  at value(/Users/laurent/Work/easydrive/dev/easydrivepro/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:105:10)

To Reproduce

Scroll inside a VirtualizedList.

After some investigation inside VirtualizedList code, I noticed this comment in https://github.com/facebook/react-native/blob/8da1f1149f5ee9f8a75cbc8baac280c95585daa2/Libraries/Lists/VirtualizedList.js

measureLayoutRelativeToContainingList(): void {
    // TODO (T35574538): findNodeHandle sometimes crashes with "Unable to find
    // node on an unmounted component" during scrolling
try {

Expected Behavior

Fix the TODO ;)

Code Example

<FlatList
    data={listStages}
    extraData={this.state}
    keyExtractor={this._keyExtractor}
   renderItem={this._renderItem}
/>

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i5 CPU         760  @ 2.80GHz
      Memory: 122.41 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.9.4 - /usr/local/bin/node
      Yarn: 1.13.0 - ~/.yarn/bin/yarn
      npm: 5.6.0 - /usr/local/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0 
      react-native: https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz => 0.57.1 
@hramos
Copy link
Contributor

hramos commented Mar 6, 2019

T35574538 (the internal task) was closed in November 2018 as fixed. You're using React Native 0.57.1, which was released September 2018.

I'm going to close this as resolved.

@hramos hramos closed this as completed Mar 6, 2019
@hramos hramos added the Resolution: Fixed A PR that fixes this issue has been merged. label Mar 6, 2019
@lc3t35
Copy link
Author

lc3t35 commented Mar 6, 2019

Thank you @hramos, maybe you can remove the internal task as TODO in the code or indicate it is fixed by RN 0.XX. By the way which version of RN is it in November 2018 ?

@hramos
Copy link
Contributor

hramos commented Mar 6, 2019

The latest stable release of React Native is 0.58, though we are about to release 0.59 this month.

After following up regarding the removal of the TODO comment, the internal task was re-opened as it looks like it can be reproed on master. I'll re-open here until it's confirmed fixed.

@stale
Copy link

stale bot commented Aug 2, 2019

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 a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 2, 2019
@stale
Copy link

stale bot commented Aug 9, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 9, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants