question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.3.0-alpha.3 / master] [iOS] `undefined is not an object (evaluating 'jsThis._closure')` — crash when using layout animation

See original GitHub issue

Description

I have an application with a large list of elements (up to several hundreds) which update in real time. After adding layout animation to the elements, the following crash starts occurring occasionally during the initial mount of the list.

Simulator Screen Shot - iPhone 11 Pro - 2021-09-14 at 17 58 23

undefined is not an object (evaluating 'jsThis._closure')

_f@/Users/admin/<…>/node_modules/react-native-reanimated/src/createAnimatedComponent.js (408:18):1:40

reanimated::REAIOSErrorHandler::raiseSpec()
    REAIOSErrorHandler.mm:17
reanimated::ErrorHandler::raise()::'lambda'()::operator()()
decltype(std::__1::forward<reanimated::ErrorHandler::raise()::'lambda'()&>(fp)()) std::__1::__invoke<reanimated::ErrorHandler::raise()::'lambda'()&>(reanimated::ErrorHandler::raise()::'lambda'()&)
void std::__1::__invoke_void_return_wrapper<void>::__call<reanimated::ErrorHandler::raise()::'lambda'()&>(reanimated::ErrorHandler::raise()::'lambda'()&)
std::__1::__function::__alloc_func<reanimated::ErrorHandler::raise()::'lambda'(), std::__1::allocator<reanimated::ErrorHandler::raise()::'lambda'()>, void ()>::operator()()
std::__1::__function::__func<reanimated::ErrorHandler::raise()::'lambda'(), std::__1::allocator<reanimated::ErrorHandler::raise()::'lambda'()>, void ()>::operator()()
std::__1::__function::__value_func<void ()>::operator()() const
std::__1::function<void ()>::operator()() const
reanimated::REAIOSScheduler::scheduleOnUI(std::__1::function<void ()>)
reanimated::ErrorHandler::raise()
reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()::operator()() const
decltype(std::__1::forward<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()&>(fp)()) std::__1::__invoke<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()&>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()&)
void std::__1::__invoke_void_return_wrapper<void>::__call<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()&>(reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()&)
std::__1::__function::__alloc_func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'(), std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()>, void ()>::operator()()
std::__1::__function::__func<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'(), std::__1::allocator<reanimated::ShareableValue::toJSValue(facebook::jsi::Runtime&)::$_3::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const::'lambda'()>, void ()>::operator()()
std::__1::__function::__value_func<void ()>::operator()() const
std::__1::function<void ()>::operator()() const
reanimated::Scheduler::triggerUI()
invocation function for block in reanimated::REAIOSScheduler::scheduleOnUI(std::__1::function<void ()>)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
0x0

Expected behavior

No crashes.

Actual behavior & steps to reproduce

Crash.

Snack or minimal code example

I believe some sort of race condition is involved, so it’s hard to reproduce artificially. So I don’t have a reproducible sample yet, but please let me know if it’s necessary.

Package versions

  • React Native: 0.65.1
  • React Native Reanimated: 2.3.0-alpha.3 (commit 772d2b12)
  • NodeJS: 16.6.1
  • Xcode: 12.5.1
  • Java & Gradle: -

Affected platforms

  • Android
  • iOS
  • Web

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SimpleCreationscommented, Jan 28, 2022

@kmagiera hi, I’m not actively working on that project right now and don’t have enough free time right now to test the new version 😬 So I guess if @craigcoles doesn’t experience this issue anymore, it’s worth closing. (I’ve actually completely opted out of using layout animations in my project due to this issue - https://github.com/software-mansion/react-native-reanimated/discussions/2513)

0reactions
craigcolescommented, Jan 28, 2022

Hi @kmagiera, we have updated our version to 2.3.1 and we are no longer seeing this issue anymore

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native - iOS device crashes "undefined is not an object ...
Yes, I use many external libraries. The error message is so vague and doesn't point me in any direction as to which library...
Read more >
connecticut department of transportation
The purpose of MMUCC is to provide a dataset for describing crashes of motor vehicles in operation that will generate the information necessary...
Read more >
Jspdf background color black code examples free online - Weebly
property in javascript object sails setup serverless web app with react netlify ... is not defined react/jsx-no-undef javascript trunc what is a closure...
Read more >
The Impact of Driver Inattention On Near-Crash/Crash Risk:
Assessment of driver's central ... 3) Driving-related inattention to the forward roadway ... Crash – Any contact with an object, either moving or...
Read more >
Fixed issues in InDesign - Adobe Support
Crash when opening a document in high quality display mode. Crash when working with documents having Type1 fonts. InDesign becomes non- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found