software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.04k stars 1.31k forks source link

[IOS] Random app crash on production build #2327

Closed abgaryanharutyun closed 1 year ago

abgaryanharutyun commented 3 years ago

Description

Getting app crash on random places with reanimated 2

Expected behavior

No crash

Actual behavior & steps to reproduce

Random behaviour

Snack or minimal code example

terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostObject::get(propName:_value): mutex lock failed: Invalid argument
workletValueSetter
[native code]
(lldb)

Package versions

Affected platforms

hmust92 commented 2 years ago

Any update on this issue?? It’s affecting our production app negatively.

I would be willing to spend time and help fix the issue too if someone can point me in a direction

nickolaz commented 2 years ago

Any update? It's affecting our app too. Anyone tell us how to fix it.

image
Gnative commented 2 years ago

If it helps anyone, check the component where you use reanimated/gestures is not rendering more than necessary.

I was running into an issue with quite a lot of freezing, hanging and crashes from having reanimated shared values set with in a FlatList item components. Noticed that there were a lot of unnecessary renders with my FlatList item components and after fixing this, with the use of memorisation, my app has become more stable and have not seen any reported app freezing since.

This might be similar to some of the earlier comments in regards to noticing this issue happens more when mounting/unmounting more complex screens

Pyroboomka commented 2 years ago

Our issues was fixed when I refactored react-navigation. Crash happened when mounting new stack navigator with a screen, that heavily uses reanimated features. So after some refactoring (remove extra stack navigator, put a problematic screen in navigator above) it kinda stopped happening. Maybe this will be helpful for someone.

amin79 commented 2 years ago

same problem here

"react-native": "0.69.4", "react-native-reanimated": "~2.9.1", "@react-navigation/stack": "^6.2.2",

arinjay commented 2 years ago

Any updates here ?

we are experiencing the same issue for months now. The issue happens when clearing multiple screens for the navigation stack.

amin79 commented 2 years ago

@arinjay They have release a new version some hours ago. I'm installing and testing. Hope it is solved in this version.

iGroza commented 2 years ago

same issue, I have random crashes on iOS release build

libc++abi: terminating with uncaught exception of type facebook::jsi::JSError
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
terminating with uncaught exception of type facebook::jsi::JSError

ENV: react-native: 0.68.2 react-native-reanimated: 2.9.1

and I use @gorhom/bottom-sheet based on reanimated2 DEVICE: iPhone 12, iOS 15.5

iGroza commented 2 years ago

same issue, I have random crashes on iOS release build

libc++abi: terminating with uncaught exception of type facebook::jsi::JSError
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
terminating with uncaught exception of type facebook::jsi::JSError

ENV: react-native: 0.68.2 react-native-reanimated: 2.9.1

and I use @gorhom/bottom-sheet based on reanimated2 DEVICE: iPhone 12, iOS 15.5

I found a solution, i just enable hermes and the error is gone πŸ₯Έ

romantseg commented 2 years ago

Any updates on this? We are seeing this issue with Hermes enabled, so unlikely it's due to that. Also noticed that this mostly happens now after XCode 14

declanelcocks commented 2 years ago

@RomanTsegelskyi anything else you've updated or enabled? I've noticed this issue happening for quite some time on even on XCode 13.

romantseg commented 2 years ago

@declanelcocks not sure. We only started seeing it after we had first built with XCode 14 and haven't seen this error before. Hermes has been enabled for a while

pke commented 1 year ago

Exact same crash happened on production using react-native-reanimated@2.2.4 and react-native-screens@3.9.0.

Not sure if this is relevant (or true), but I have reason to believe screens is related because sentry tells me it happens in a transaction called RNSScreen: Screenshot 2021-12-13 at 13 25 58

(crashlytics reports the exact same error message as in #2327 (comment))

We are also experiencing this:

image

And the reason seems obvious. An unchecked null ptr access. The reanimated code is riddled with unchecked access to pointers and could really need a thorough linting cure.

image It even says in the comment can be null, yet RNRA just chains calls on it, without any try..catch protection.

rajeevverma076 commented 1 year ago

gqrdcujrclsvvkajsamfabzowwpi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNReanimated.build/Objects-normal/x86_64/UIResponder+Reanimated.dia:1:1: warning: Could not read serialized diagnostics file: error("Failed to open diagnostics file") (in target 'RNReanimated' from project 'Pods')

"react-native-reanimated": "^2.11.0", "react-native": "0.68.2",

Not able to run ios build

shivamp2404 commented 1 year ago

More detailed logs:

"react-native": "0.66.0",
"react-native-reanimated": "2.3.1",
Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
CoreSimulator 776.3 - Device: iPhone 12 Pro (74D7A1A8-E30D-4885-BBA8-5C3996E03C1C) - Runtime: iOS 15.0 (19A339) - DeviceType: iPhone 12 Pro
terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostObject::get(propName:_value): mutex lock failed: Invalid argument
workletValueSetter@/Users/user/app-react-native/node_modules/react-native-reanimated/src/reanimated2/core.ts (192:0):1:1085
@[native code]
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
abort() called

Kernel Triage:
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   ???                                    0x17ee52940 ???
1   <translation info unavailable>         0x17fb17aec ???
2   libsystem_pthread.dylib                0x11f5981ff pthread_kill + 263
3   libsystem_c.dylib                      0x11f73871e __abort + 139
4   libsystem_c.dylib                      0x11f738693 abort + 138
5   libc++abi.dylib                        0x115e285c2 abort_message + 241
6   libc++abi.dylib                        0x115e19755 demangling_terminate_handler() + 242
7   libobjc.A.dylib                        0x1143cbc23 _objc_terminate() + 104
8   myapp                              0x102e8fc25 FIRCLSTerminateHandler() + 325
9   libc++abi.dylib                        0x115e279e7 std::__terminate(void (*)()) + 8
10  libc++abi.dylib                        0x115e27998 std::terminate() + 56
11  libdispatch.dylib                      0x11e366a6a _dispatch_client_callout + 28
12  libdispatch.dylib                      0x11e373e20 _dispatch_main_queue_callback_4CF + 1073
13  CoreFoundation                         0x12112185d __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
14  CoreFoundation                         0x12111c0ba __CFRunLoopRun + 2772
15  CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
16  GraphicsServices                       0x1228d5cd3 GSEventRunModal + 139
17  UIKitCore                              0x1375d9e63 -[UIApplication _run] + 928
18  UIKitCore                              0x1375dea53 UIApplicationMain + 101
19  myapp                              0x102abbbdf main + 63 (AppDelegate.swift:86)
20  dyld_sim                               0x110e63e1e start_sim + 10
21  dyld                                   0x208ae051e start + 462

Thread 1:: com.apple.rosetta.exceptionserver
0   ???                                 0x7ff7ffed79a4 ???
1   ???                                 0x7ff7ffef0208 ???

Thread 2:: com.apple.uikit.eventfetch-thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   CoreFoundation                         0x121121450 __CFRunLoopServiceMachPort + 319
4   CoreFoundation                         0x12111baf3 __CFRunLoopRun + 1293
5   CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
6   Foundation                             0x11826341c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213
7   Foundation                             0x118263693 -[NSRunLoop(NSRunLoop) runUntilDate:] + 72
8   UIKitCore                              0x13769a0b9 -[UIEventFetcher threadMain] + 491
9   Foundation                             0x11828c142 __NSThread__start__ + 999
10  libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
11  libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 3:
0   ???                                 0x7ff7ffef5814 ???

Thread 4:: com.google.firebase.crashlytics.MachExceptionServer
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   myapp                              0x102e9bf01 FIRCLSMachExceptionReadMessage + 81
4   myapp                              0x102e9be40 FIRCLSMachExceptionServer + 48
5   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
6   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 5:: com.apple.NSURLConnectionLoader
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   CoreFoundation                         0x121121450 __CFRunLoopServiceMachPort + 319
4   CoreFoundation                         0x12111baf3 __CFRunLoopRun + 1293
5   CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
6   CFNetwork                              0x113d2037e 0x113ae7000 + 2331518
7   Foundation                             0x11828c142 __NSThread__start__ + 999
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 6:: JavaScriptCore bmalloc scavenger
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   libc++.1.dylib                         0x110d86a73 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 93
4   JavaScriptCore                         0x11cc7e3c2 bmalloc::Scavenger::threadRunLoop() + 882
5   JavaScriptCore                         0x11cc7dae9 bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*) + 9
6   JavaScriptCore                         0x11cc7f3e7 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::Scavenger*), bmalloc::Scavenger*> >(void*) + 39
7   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
8   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 7:: AVAudioSession Notify Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   CoreFoundation                         0x121121450 __CFRunLoopServiceMachPort + 319
4   CoreFoundation                         0x12111baf3 __CFRunLoopRun + 1293
5   CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
6   AudioSession                           0x11f7d8f1d CADeprecated::GenericRunLoopThread::Entry(void*) + 157
7   AudioSession                           0x11f7eab89 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 77
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 8:: AMCP Logging Spool
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1097d1284 ???
2   caulk                                  0x120e6fa56 caulk::mach::semaphore::wait_or_error() + 16
3   caulk                                  0x120e6ae2e caulk::concurrent::details::worker_thread::run() + 36
4   caulk                                  0x120e6ae82 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 41
5   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
6   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 9:: com.apple.CFNetwork.CustomProtocols
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   CoreFoundation                         0x121121450 __CFRunLoopServiceMachPort + 319
4   CoreFoundation                         0x12111baf3 __CFRunLoopRun + 1293
5   CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
6   CFNetwork                              0x113d2037e 0x113ae7000 + 2331518
7   Foundation                             0x11828c142 __NSThread__start__ + 999
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 10:: com.squareup.SocketRocket.NetworkThread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   CoreFoundation                         0x121121450 __CFRunLoopServiceMachPort + 319
4   CoreFoundation                         0x12111baf3 __CFRunLoopRun + 1293
5   CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
6   Foundation                             0x11826341c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213
7   myapp_ios                              0x127c261e2 -[_RCTSRRunLoopThread main] + 338 (RCTSRWebSocket.m:1620)
8   Foundation                             0x11828c142 __NSThread__start__ + 999
9   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
10  libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 11:: com.apple.CFSocket.private
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1097f4e84 ???
2   CoreFoundation                         0x121136260 __CFSocketManager + 628
3   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
4   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 12:: JIT Worklist Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 13:: com.facebook.react.JavaScript
0   <translation info unavailable>         0x10b0b9bb4 ???
1   <translation info unavailable>         0x10b0b96c8 ???
2   myapp_ios                              0x127e96b15 facebook::jsc::JSCRuntime::JSCStringValue::~JSCStringValue() + 21 (JSCRuntime.cpp:105)
3   myapp_ios                              0x127e96ae6 facebook::jsc::JSCRuntime::JSCStringValue::invalidate() + 70 (JSCRuntime.cpp:534)
4   myapp_ios                              0x127c8157d facebook::jsi::Pointer::~Pointer() + 45 (jsi.h:366)
5   myapp_ios                              0x127ad09c5 facebook::jsi::String::~String() + 21 (jsi.h:478)
6   myapp_ios                              0x127ad0805 facebook::jsi::String::~String() + 21 (jsi.h:478)
7   myapp_ios                              0x127a4e489 reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 649 (FrozenObject.cpp:22)
8   myapp_ios                              0x127a4e86d reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 45 (FrozenObject.cpp:11)
9   myapp_ios                              0x127b1de37 std::__1::__shared_ptr_emplace<reanimated::FrozenObject, std::__1::allocator<reanimated::FrozenObject> >::__shared_ptr_emplace<facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&>(std::__1::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&) + 167 (memory:2627)
10  myapp_ios                              0x127b1dafd std::__1::__shared_ptr_emplace<reanimated::FrozenObject, std::__1::allocator<reanimated::FrozenObject> >::__shared_ptr_emplace<facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&>(std::__1::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&) + 45 (memory:2621)
11  myapp_ios                              0x127b1d9d4 std::__1::shared_ptr<reanimated::FrozenObject> std::__1::allocate_shared<reanimated::FrozenObject, std::__1::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(std::__1::allocator<reanimated::FrozenObject> const&, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&) + 148 (memory:3385)
12  myapp_ios                              0x127b14b57 std::__1::shared_ptr<reanimated::FrozenObject> std::__1::make_shared<reanimated::FrozenObject, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&) + 103 (memory:3394)
13  myapp_ios                              0x127b13c87 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 4135 (ShareableValue.cpp:164)
14  myapp_ios                              0x127b14e9b reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 203 (ShareableValue.cpp:194)
15  myapp_ios                              0x127b13903 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 3235 (ShareableValue.cpp:141)
16  myapp_ios                              0x127b14e9b reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 203 (ShareableValue.cpp:194)
17  myapp_ios                              0x127a73649 reanimated::MutableValue::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&) + 1561 (MutableValue.cpp:66)
18  myapp_ios                              0x127e9e06c facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::setProperty(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const*, OpaqueJSValue const**) + 156 (JSCRuntime.cpp:766)
19  JavaScriptCore                         0x11bdf2b13 JSC::JSCallbackObject<JSC::JSNonFinalObject>::put(JSC::JSCell*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 291
20  JavaScriptCore                         0x11c529bab JSC::operationPutByIdNonStrict(JSC::JSGlobalObject*, JSC::StructureStubInfo*, long long, long long, unsigned long) + 1467
21  ???                                 0x2d8ce35964f5 ???
22  ???                                 0x2d8ce342f12b ???
23  ???                                 0x2d8ce3484640 ???
24  ???                                 0x2d8ce32af10c ???
25  ???                                 0x2d8ce30ead47 ???
26  ???                                 0x2d8ce31f7dc0 ???
27  ???                                 0x2d8ce30050aa ???
28  ???                                 0x2d8ce3002b17 ???
29  JavaScriptCore                         0x11bd52d06 vmEntryToJavaScript + 216
30  JavaScriptCore                         0x11c4920bc JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 540
31  JavaScriptCore                         0x11c7dd343 JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 707
32  JavaScriptCore                         0x11bd52e58 vmEntryToNative + 226
33  JavaScriptCore                         0x11c4920eb JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 587
34  JavaScriptCore                         0x11c721a74 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 164
35  JavaScriptCore                         0x11be09e29 JSObjectCallAsFunction + 665
36  myapp_ios                              0x127e98fa3 facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 339 (JSCRuntime.cpp:1260)
37  myapp_ios                              0x127ea8189 facebook::jsi::Function::call(facebook::jsi::Runtime&, facebook::jsi::Value const*, unsigned long) const + 105 (jsi-inl.h:228)
38  myapp_ios                              0x127ea80c5 facebook::jsi::Function::call(facebook::jsi::Runtime&, std::initializer_list<facebook::jsi::Value>) const + 101 (jsi-inl.h:233)
39  myapp_ios                              0x127ed0ddd facebook::jsi::Value facebook::jsi::Function::call<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value&&) const + 365 (jsi-inl.h:241)
40  myapp_ios                              0x127ed0bf9 facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5::operator()() const + 153 (JSIExecutor.cpp:256)
41  myapp_ios                              0x127ed0b3d decltype(std::__1::forward<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5&>(fp)()) std::__1::__invoke<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5&>(facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5&) + 29 (type_traits:3694)
42  myapp_ios                              0x127ed0aed void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5&>(facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5&) + 29 (__functional_base:348)
43  myapp_ios                              0x127ed0abd std::__1::__function::__alloc_func<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5, std::__1::allocator<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5>, void ()>::operator()() + 29 (functional:1558)
44  myapp_ios                              0x127ecf9f9 std::__1::__function::__func<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5, std::__1::allocator<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_5>, void ()>::operator()() + 25 (functional:1732)
45  myapp_ios                              0x127c870c2 std::__1::__function::__value_func<void ()>::operator()() const + 50 (functional:1885)
46  myapp_ios                              0x127c86ff5 std::__1::function<void ()>::operator()() const + 21 (functional:2560)
47  myapp_ios                              0x127b38395 facebook::react::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>) + 21 (JSIExecutor.h:107)
48  myapp_ios                              0x127b3adcc decltype(std::__1::forward<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>(fp)(std::__1::forward<std::__1::function<void ()> const&>(fp0), std::__1::forward<std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()> >(fp0))) std::__1::__invoke<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()> >(void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 108 (type_traits:3694)
49  myapp_ios                              0x127b3ad37 void std::__1::__invoke_void_return_wrapper<void, true>::__call<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()> >(void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 71 (__functional_base:348)
50  myapp_ios                              0x127b3acc7 std::__1::__function::__alloc_func<void (*)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::allocator<void (*)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>, void (std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>::operator()(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 71 (functional:1558)
51  myapp_ios                              0x127b398a6 std::__1::__function::__func<void (*)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::allocator<void (*)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>, void (std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>::operator()(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 70 (functional:1732)
52  myapp_ios                              0x127ecf01f std::__1::__function::__value_func<void (std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>::operator()(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) const + 95 (functional:1885)
53  myapp_ios                              0x127ebfce2 std::__1::function<void (std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)>::operator()(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>) const + 66 (functional:2560)
54  myapp_ios                              0x127ebf8f9 facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&) + 457 (JSIExecutor.cpp:254)
55  myapp_ios                              0x127e0ea24 facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2::operator()(facebook::react::JSExecutor*) const + 724 (NativeToJsBridge.cpp:207)
56  myapp_ios                              0x127e0e732 decltype(std::__1::forward<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2&>(fp)(std::__1::forward<facebook::react::JSExecutor*>(fp0))) std::__1::__invoke<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2&, facebook::react::JSExecutor*&&) + 50 (type_traits:3694)
57  myapp_ios                              0x127e0e6d2 void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2&, facebook::react::JSExecutor*&&) + 50 (__functional_base:348)
58  myapp_ios                              0x127e0e692 std::__1::__function::__alloc_func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) + 50 (functional:1558)
59  myapp_ios                              0x127e0d331 std::__1::__function::__func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_2>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) + 49 (functional:1732)
60  myapp_ios                              0x127e19c4a std::__1::__function::__value_func<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) const + 74 (functional:1885)
61  myapp_ios                              0x127e19bcd std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const + 45 (functional:2560)
62  myapp_ios                              0x127e19b97 facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8::operator()() const + 87 (NativeToJsBridge.cpp:310)
63  myapp_ios                              0x127e19b1d decltype(std::__1::forward<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&>(fp)()) std::__1::__invoke<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&) + 29 (type_traits:3694)
64  myapp_ios                              0x127e19acd void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&) + 29 (__functional_base:348)
65  myapp_ios                              0x127e19a9d std::__1::__function::__alloc_func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() + 29 (functional:1558)
66  myapp_ios                              0x127e18619 std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() + 25 (functional:1732)
67  myapp_ios                              0x127c870c2 std::__1::__function::__value_func<void ()>::operator()() const + 50 (functional:1885)
68  myapp_ios                              0x127c86ff5 std::__1::function<void ()>::operator()() const + 21 (functional:2560)
69  myapp_ios                              0x127b947b5 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 21 (RCTCxxUtils.mm:74)
70  myapp_ios                              0x127bc2a71 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 33 (RCTMessageThread.mm:69)
71  myapp_ios                              0x127bc7d73 facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1::operator()() const + 83 (RCTMessageThread.mm:82)
72  myapp_ios                              0x127bc7cfd decltype(std::__1::forward<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(fp)()) std::__1::__invoke<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) + 29 (type_traits:3694)
73  myapp_ios                              0x127bc7cad void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) + 29 (__functional_base:348)
74  myapp_ios                              0x127bc7c7d std::__1::__function::__alloc_func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()() + 29 (functional:1558)
75  myapp_ios                              0x127bc68f9 std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()() + 25 (functional:1732)
76  myapp_ios                              0x127c870c2 std::__1::__function::__value_func<void ()>::operator()() const + 50 (functional:1885)
77  myapp_ios                              0x127c86ff5 std::__1::function<void ()>::operator()() const + 21 (functional:2560)
78  myapp_ios                              0x127bc27da invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 42 (RCTMessageThread.mm:45)
79  CoreFoundation                         0x121121bbb __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
80  CoreFoundation                         0x121120fc1 __CFRunLoopDoBlocks + 443
81  CoreFoundation                         0x12111be15 __CFRunLoopRun + 2095
82  CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
83  myapp_ios                              0x127b632a2 +[RCTCxxBridge runRunLoop] + 962 (RCTCxxBridge.mm:367)
84  Foundation                             0x11828c142 __NSThread__start__ + 999
85  libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
86  libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 14:: com.apple.CFStream.LegacyThread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x1087d4834 ???
2   libsystem_kernel.dylib                 0x11f770ce8 mach_msg + 56
3   CoreFoundation                         0x121121450 __CFRunLoopServiceMachPort + 319
4   CoreFoundation                         0x12111baf3 __CFRunLoopRun + 1293
5   CoreFoundation                         0x12111b103 CFRunLoopRunSpecific + 567
6   CoreFoundation                         0x121144c4c _legacyStreamRunLoop_workThread + 249
7   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
8   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 15:
0   ???                                 0x7ff7ffef5814 ???

Thread 16:
0   ???                                 0x7ff7ffef5814 ???

Thread 17:: JSC Heap Collector Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 18:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 19:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 20:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 21:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 22:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 23:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 24:: Heap Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 25:: JSC Heap Collector Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 26:: JIT Worklist Helper Thread
0   ???                                    0x108748940 ???
1   <translation info unavailable>         0x108beac24 ???
2   libsystem_pthread.dylib                0x11f598a6f _pthread_cond_wait + 1249
3   JavaScriptCore                         0x11cbf99a7 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 3591
4   JavaScriptCore                         0x11c363c6a bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 154
5   JavaScriptCore                         0x11cbc354b WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 379
6   JavaScriptCore                         0x11cc20fff WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 255
7   JavaScriptCore                         0x11cc23d39 WTF::wtfThreadEntryPoint(void*) + 9
8   libsystem_pthread.dylib                0x11f5984e1 _pthread_start + 125
9   libsystem_pthread.dylib                0x11f593f6b thread_start + 15

Thread 27:
0   ???                                 0x7ff7ffef5814 ???

Thread 28:
0   ???                                 0x7ff7ffef5814 ???

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000208b5b600  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x000000030d991d10  rsi: 0x0000000000000003  rbp: 0x0000000000989680  rsp: 0x0000000000000000
   r8: 0x000000030d991d08   r9: 0x0000000000989680  r10: 0x0000000208b5b600  r11: 0x30313a313a29303a
  r12: 0x0000000000000103  r13: 0x0000003000000008  r14: 0x0000000000000006  r15: 0x0000000000000016
  rip: <unavailable>       rfl: 0x0000000000000283
 tmp0: 0xffffffffffffffff tmp1: 0x000000017ee52914 tmp2: 0x0000000172cb3470

Binary Images:
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x11f592000 -        0x11f59dfff libsystem_pthread.dylib (*) <2f6c275d-7e14-3d31-a924-e1bb41d2415f> /usr/lib/system/libsystem_pthread.dylib
       0x11f6bc000 -        0x11f73ffff libsystem_c.dylib (*) <51aca1b3-4ccf-3807-bad5-887c92fd66a8> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib
       0x115e18000 -        0x115e2dfff libc++abi.dylib (*) <0730c74e-ae80-3f64-92c9-fe946463a8de> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib
       0x1143c6000 -        0x1143f7fff libobjc.A.dylib (*) <8d646e32-1ecc-300d-acea-e906348ab594> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib
       0x100e02000 -        0x103fe5fff com.myapp.customer.debug (5.38) <8b1414da-f0af-3565-a1c8-b71448d96754> /Users/USER/Library/Developer/CoreSimulator/Devices/74D7A1A8-E30D-4885-BBA8-5C3996E03C1C/data/Containers/Bundle/Application/1A569B51-BF2A-4F81-B8DE-0E01EC4A0452/myapp.app/myapp
       0x11e364000 -        0x11e3aafff libdispatch.dylib (*) <888b1439-4deb-36fa-9ca2-6761a53541b5> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib
       0x1210a1000 -        0x1214a2fff com.apple.CoreFoundation (6.9) <1e31c79c-63d5-3c10-857d-2d64f9efcc55> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
       0x1228d2000 -        0x1228dafff com.apple.GraphicsServices (1.0) <c48119f4-7524-3ffa-99a4-f2ed0ed96793> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
       0x136912000 -        0x13817efff com.apple.UIKitCore (1.0) <9b492a0f-d6a5-3bc5-9689-50586f8db216> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
       0x110e62000 -        0x110eaefff dyld_sim (*) <d494c297-dc73-394b-901e-1b5930e801df> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
       0x208adb000 -        0x208b46fff dyld (*) <dd9e80de-fb3b-349b-96a4-46874ad34d11> /usr/lib/dyld
       0x11f76f000 -        0x11f7a6fff libsystem_kernel.dylib (*) <26a59789-b846-3ed4-96dc-8dbef3c0c8e7> /usr/lib/system/libsystem_kernel.dylib
       0x118141000 -        0x11842ffff com.apple.Foundation (6.9) <02621b3d-174a-37be-879c-4be0f0fa8d96> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation
       0x113ae7000 -        0x113f72fff com.apple.CFNetwork (1312) <35b9ca69-ac1b-3620-beb0-728fe87c024d> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork
       0x110d7e000 -        0x110dd3fff libc++.1.dylib (*) <0671d992-833a-3db2-aaf7-de1b5a18dd4b> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib
       0x11bace000 -        0x11cdacfff com.apple.JavaScriptCore (8612) <9c11a3c8-fb8a-332f-9344-728e9cae9b64> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
       0x11f7d7000 -        0x11f7fdfff com.apple.audio.AudioSession (1.0) <bafd4874-f589-3ffe-831b-9a1af5fe804c> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioSession.framework/AudioSession
       0x120e54000 -        0x120e77fff com.apple.audio.caulk (1.0) <5a4164bf-1c0f-3d8a-82bb-de08905b14c5> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/caulk.framework/caulk
       0x126c04000 -        0x1285bffff com.myapp.myapp-ios (1.0) <6b9fc012-9f0a-34f6-aa41-5a081d21f710> /Users/USER/Library/Developer/CoreSimulator/Devices/74D7A1A8-E30D-4885-BBA8-5C3996E03C1C/data/Containers/Bundle/Application/1A569B51-BF2A-4F81-B8DE-0E01EC4A0452/myapp.app/Frameworks/myapp_ios.framework/myapp_ios

Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed

EOF
JB-CHAUVIN commented 1 year ago

I fixed the issue with the following patch.

I had the following error when running the app in "release mode" with XCODE : workletFun.bind is undefined...

Here is the patch package :

diff --git a/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js b/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js
index f6beec5..b89ca58 100644
--- a/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js
+++ b/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js
@@ -59,23 +59,23 @@ function valueUnpacker(objectToUnpack, category) {
         // we want to use the proper filename for the location as it guarantees
         // that debugger understands and loads the source code of the file where
         // the worklet is defined.
-        workletFun = global.evalWithSourceMap('(' + initData.code + '\n)', initData.location, initData.sourceMap);
+        workletFun = global.evalWithSourceMap('(' + initData?.code + '\n)', initData?.location, initData?.sourceMap);
       } else if (global.evalWithSourceUrl) {
         // if the runtime doesn't support loading source maps, in dev mode we
         // can pass source url when evaluating the worklet. Now, instead of using
         // the actual file location we use worklet hash, as it the allows us to
         // properly symbolicate traces (see errors.ts for details)
-        workletFun = global.evalWithSourceUrl('(' + initData.code + '\n)', `worklet_${workletHash}`);
+        workletFun = global.evalWithSourceUrl('(' + initData?.code + '\n)', `worklet_${workletHash}`);
       } else {
         // in release we use the regular eval to save on JSI calls
         // eslint-disable-next-line no-eval
-        workletFun = eval('(' + initData.code + '\n)');
+        workletFun = eval('(' + initData?.code + '\n)');
       }

       workletsCache.set(workletHash, workletFun);
     }

-    const functionInstance = workletFun.bind(objectToUnpack);
+    const functionInstance = workletFun?.bind?.(objectToUnpack);
     objectToUnpack._recur = functionInstance;
     return functionInstance;
   } else if (objectToUnpack.__init) {
diff --git a/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js.map b/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js.map
index 7488c89..c48c9b8 100644
--- a/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js.map
+++ b/node_modules/react-native-reanimated/lib/commonjs/reanimated2/initializers.js.map
@@ -1 +1 @@
-{"version":3,"names":["callGuardDEV","fn","args","e","global","ErrorUtils","reportFatalError","valueUnpacker","objectToUnpack","category","workletsCache","__workletsCache","handleCache","__handleCache","undefined","Map","WeakMap","workletHash","__workletHash","workletFun","get","initData","__initData","evalWithSourceMap","code","location","sourceMap","evalWithSourceUrl","eval","set","functionInstance","bind","_recur","__init","value","fun","Error","__remoteFunction","setupRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","animationFrameCallbacks","lastNativeAnimationFrameTimestamp","__flushAnimationFrame","frameTimestamp","currentCallbacks","forEach","f","flushImmediates","callback","push","length","timestamp","__frameTimestamp","initializeUIRuntime","NativeReanimatedModule","installCoreFunctions","IS_JEST","isJest","setTimeout","performance","now","capturableConsole","console","runOnUIImmediately","error","runOnJS","reportFatalErrorOnJS","message","stack","debug","log","warn","info","setupSetImmediate"],"sources":["initializers.ts"],"sourcesContent":["import { reportFatalErrorOnJS } from './errors';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { isJest } from './PlatformChecker';\nimport {\n  runOnJS,\n  setupSetImmediate,\n  flushImmediates,\n  runOnUIImmediately,\n} from './threads';\n\n// callGuard is only used with debug builds\nfunction callGuardDEV<T extends Array<any>, U>(\n  fn: (...args: T) => U,\n  ...args: T\n): void {\n  'worklet';\n  try {\n    fn(...args);\n  } catch (e) {\n    if (global.ErrorUtils) {\n      global.ErrorUtils.reportFatalError(e as Error);\n    } else {\n      throw e;\n    }\n  }\n}\n\nfunction valueUnpacker(objectToUnpack: any, category?: string): any {\n  'worklet';\n  let workletsCache = global.__workletsCache;\n  let handleCache = global.__handleCache;\n  if (workletsCache === undefined) {\n    // init\n    workletsCache = global.__workletsCache = new Map();\n    handleCache = global.__handleCache = new WeakMap();\n  }\n  const workletHash = objectToUnpack.__workletHash;\n  if (workletHash !== undefined) {\n    let workletFun = workletsCache.get(workletHash);\n    if (workletFun === undefined) {\n      const initData = objectToUnpack.__initData;\n      if (global.evalWithSourceMap) {\n        // if the runtime (hermes only for now) supports loading source maps\n        // we want to use the proper filename for the location as it guarantees\n        // that debugger understands and loads the source code of the file where\n        // the worklet is defined.\n        workletFun = global.evalWithSourceMap(\n          '(' + initData.code + '\\n)',\n          initData.location,\n          initData.sourceMap\n        ) as (...args: any[]) => any;\n      } else if (global.evalWithSourceUrl) {\n        // if the runtime doesn't support loading source maps, in dev mode we\n        // can pass source url when evaluating the worklet. Now, instead of using\n        // the actual file location we use worklet hash, as it the allows us to\n        // properly symbolicate traces (see errors.ts for details)\n        workletFun = global.evalWithSourceUrl(\n          '(' + initData.code + '\\n)',\n          `worklet_${workletHash}`\n        ) as (...args: any[]) => any;\n      } else {\n        // in release we use the regular eval to save on JSI calls\n        // eslint-disable-next-line no-eval\n        workletFun = eval('(' + initData.code + '\\n)') as (\n          ...args: any[]\n        ) => any;\n      }\n      workletsCache.set(workletHash, workletFun);\n    }\n    const functionInstance = workletFun.bind(objectToUnpack);\n    objectToUnpack._recur = functionInstance;\n    return functionInstance;\n  } else if (objectToUnpack.__init) {\n    let value = handleCache!.get(objectToUnpack);\n    if (value === undefined) {\n      value = objectToUnpack.__init();\n      handleCache!.set(objectToUnpack, value);\n    }\n    return value;\n  } else if (category === 'RemoteFunction') {\n    const fun = () => {\n      throw new Error(`Tried to synchronously call a non-worklet function on the UI thread.\n\nPossible solutions are:\n  a) If you want to synchronously execute this method, mark it as a worklet\n  b) If you want to execute this function on the JS thread, wrap it using \\`runOnJS\\``);\n    };\n    fun.__remoteFunction = objectToUnpack;\n    return fun;\n  } else {\n    throw new Error('data type not recognized by unpack method');\n  }\n}\n\nfunction setupRequestAnimationFrame() {\n  'worklet';\n\n  // Jest mocks requestAnimationFrame API and it does not like if that mock gets overridden\n  // so we avoid doing requestAnimationFrame batching in Jest environment.\n  const nativeRequestAnimationFrame = global.requestAnimationFrame;\n\n  let animationFrameCallbacks: Array<(timestamp: number) => void> = [];\n  let lastNativeAnimationFrameTimestamp = -1;\n\n  global.__flushAnimationFrame = (frameTimestamp: number) => {\n    const currentCallbacks = animationFrameCallbacks;\n    animationFrameCallbacks = [];\n    currentCallbacks.forEach((f) => f(frameTimestamp));\n    flushImmediates();\n  };\n\n  global.requestAnimationFrame = (\n    callback: (timestamp: number) => void\n  ): number => {\n    animationFrameCallbacks.push(callback);\n    if (animationFrameCallbacks.length === 1) {\n      // We schedule native requestAnimationFrame only when the first callback\n      // is added and then use it to execute all the enqueued callbacks. Once\n      // the callbacks are run, we clear the array.\n      nativeRequestAnimationFrame((timestamp) => {\n        if (lastNativeAnimationFrameTimestamp >= timestamp) {\n          // Make sure we only execute the callbacks once for a given frame\n          return;\n        }\n        lastNativeAnimationFrameTimestamp = timestamp;\n        global.__frameTimestamp = timestamp;\n        global.__flushAnimationFrame(timestamp);\n        global.__frameTimestamp = undefined;\n      });\n    }\n    // Reanimated currently does not support cancelling callbacks requested with\n    // requestAnimationFrame. We return -1 as identifier which isn't in line\n    // with the spec but it should give users better clue in case they actually\n    // attempt to store the value returned from rAF and use it for cancelling.\n    return -1;\n  };\n}\n\nexport function initializeUIRuntime() {\n  NativeReanimatedModule.installCoreFunctions(callGuardDEV, valueUnpacker);\n\n  const IS_JEST = isJest();\n\n  if (IS_JEST) {\n    // requestAnimationFrame react-native jest's setup is incorrect as it polyfills\n    // the method directly using setTimeout, therefore the callback doesn't get the\n    // expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/jest/setup.js#L28\n    // We override this setup here to make sure that callbacks get the proper timestamps\n    // when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame\n    // @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number\n    global.requestAnimationFrame = (callback: (timestamp: number) => void) => {\n      return setTimeout(() => callback(performance.now()), 0);\n    };\n  }\n\n  const capturableConsole = console;\n  runOnUIImmediately(() => {\n    'worklet';\n    // setup error handler\n    global.ErrorUtils = {\n      reportFatalError: (error: Error) => {\n        runOnJS(reportFatalErrorOnJS)({\n          message: error.message,\n          stack: error.stack,\n        });\n      },\n    };\n\n    // setup console\n    // @ts-ignore TypeScript doesn't like that there are missing methods in console object, but we don't provide all the methods for the UI runtime console version\n    global.console = {\n      debug: runOnJS(capturableConsole.debug),\n      log: runOnJS(capturableConsole.log),\n      warn: runOnJS(capturableConsole.warn),\n      error: runOnJS(capturableConsole.error),\n      info: runOnJS(capturableConsole.info),\n    };\n\n    if (!IS_JEST) {\n      setupSetImmediate();\n      setupRequestAnimationFrame();\n    }\n  })();\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAOA;AACA,SAASA,YAAT,CACEC,EADF,EAGQ;EACN;;EADM,kCADHC,IACG;IADHA,IACG;EAAA;;EAEN,IAAI;IACFD,EAAE,CAAC,GAAGC,IAAJ,CAAF;EACD,CAFD,CAEE,OAAOC,CAAP,EAAU;IACV,IAAIC,MAAM,CAACC,UAAX,EAAuB;MACrBD,MAAM,CAACC,UAAP,CAAkBC,gBAAlB,CAAmCH,CAAnC;IACD,CAFD,MAEO;MACL,MAAMA,CAAN;IACD;EACF;AACF;;AAED,SAASI,aAAT,CAAuBC,cAAvB,EAA4CC,QAA5C,EAAoE;EAClE;;EACA,IAAIC,aAAa,GAAGN,MAAM,CAACO,eAA3B;EACA,IAAIC,WAAW,GAAGR,MAAM,CAACS,aAAzB;;EACA,IAAIH,aAAa,KAAKI,SAAtB,EAAiC;IAC/B;IACAJ,aAAa,GAAGN,MAAM,CAACO,eAAP,GAAyB,IAAII,GAAJ,EAAzC;IACAH,WAAW,GAAGR,MAAM,CAACS,aAAP,GAAuB,IAAIG,OAAJ,EAArC;EACD;;EACD,MAAMC,WAAW,GAAGT,cAAc,CAACU,aAAnC;;EACA,IAAID,WAAW,KAAKH,SAApB,EAA+B;IAC7B,IAAIK,UAAU,GAAGT,aAAa,CAACU,GAAd,CAAkBH,WAAlB,CAAjB;;IACA,IAAIE,UAAU,KAAKL,SAAnB,EAA8B;MAC5B,MAAMO,QAAQ,GAAGb,cAAc,CAACc,UAAhC;;MACA,IAAIlB,MAAM,CAACmB,iBAAX,EAA8B;QAC5B;QACA;QACA;QACA;QACAJ,UAAU,GAAGf,MAAM,CAACmB,iBAAP,CACX,MAAMF,QAAQ,CAACG,IAAf,GAAsB,KADX,EAEX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ACA,IAAAC,2BAAA,EAAmB,MAAM;IACvB,UADuB,CAEvB;;IACA5D,MAAM,CAACC,UAAP,GAAoB;MAClBC,gBAAgB,EAAG2D,KAAD,IAAkB;QAClC,IAAAC,gBAAA,EAAQC,4BAAR,EAA8B;UAC5BC,OAAO,EAAEH,KAAK,CAACG,OADa;UAE5BC,KAAK,EAAEJ,KAAK,CAACI;QAFe,CAA9B;MAID;IANiB,CAApB,CAHuB,CAYvB;IACA;;IACAjE,MAAM,CAAC2D,OAAP,GAAiB;MACfO,KAAK,EAAE,IAAAJ,gBAAA,EAAQJ,iBAAiB,CAACQ,KAA1B,CADQ;MAEfC,GAAG,EAAE,IAAAL,gBAAA,EAAQJ,iBAAiB,CAACS,GAA1B,CAFU;MAGfC,IAAI,EAAE,IAAAN,gBAAA,EAAQJ,iBAAiB,CAACU,IAA1B,CAHS;MAIfP,KAAK,EAAE,IAAAC,gBAAA,EAAQJ,iBAAiB,CAACG,KAA1B,CAJQ;MAKfQ,IAAI,EAAE,IAAAP,gBAAA,EAAQJ,iBAAiB,CAACW,IAA1B;IALS,CAAjB;;IAQA,IAAI,CAAChB,OAAL,EAAc;MACZ,IAAAiB,0BAAA;MACApC,0BAA0B;IAC3B;EACF,CA1BD;AA2BD"}
\ No newline at end of file
+{"version":3,"names":["callGuardDEV","fn","args","e","global","ErrorUtils","reportFatalError","valueUnpacker","objectToUnpack","category","workletsCache","__workletsCache","handleCache","__handleCache","undefined","Map","WeakMap","workletHash","__workletHash","workletFun","get","initData","__initData","evalWithSourceMap","code","location","sourceMap","evalWithSourceUrl","eval","set","functionInstance","bind","_recur","__init","value","fun","Error","__remoteFunction","setupRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","animationFrameCallbacks","lastNativeAnimationFrameTimestamp","__flushAnimationFrame","frameTimestamp","currentCallbacks","forEach","f","flushImmediates","callback","push","length","timestamp","__frameTimestamp","initializeUIRuntime","NativeReanimatedModule","installCoreFunctions","IS_JEST","isJest","setTimeout","performance","now","capturableConsole","console","runOnUIImmediately","error","runOnJS","reportFatalErrorOnJS","message","stack","debug","log","warn","info","setupSetImmediate"],"sources":["initializers.ts"],"sourcesContent":["import { reportFatalErrorOnJS } from './errors';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { isJest } from './PlatformChecker';\nimport {\n  runOnJS,\n  setupSetImmediate,\n  flushImmediates,\n  runOnUIImmediately,\n} from './threads';\n\n// callGuard is only used with debug builds\nfunction callGuardDEV<T extends Array<any>, U>(\n  fn: (...args: T) => U,\n  ...args: T\n): void {\n  'worklet';\n  try {\n    fn(...args);\n  } catch (e) {\n    if (global.ErrorUtils) {\n      global.ErrorUtils.reportFatalError(e as Error);\n    } else {\n      throw e;\n    }\n  }\n}\n\nfunction valueUnpacker(objectToUnpack: any, category?: string): any {\n  'worklet';\n  let workletsCache = global.__workletsCache;\n  let handleCache = global.__handleCache;\n  if (workletsCache === undefined) {\n    // init\n    workletsCache = global.__workletsCache = new Map();\n    handleCache = global.__handleCache = new WeakMap();\n  }\n  const workletHash = objectToUnpack.__workletHash;\n  if (workletHash !== undefined) {\n    let workletFun = workletsCache.get(workletHash);\n    if (workletFun === undefined) {\n      const initData = objectToUnpack.__initData;\n      if (global.evalWithSourceMap) {\n        // if the runtime (hermes only for now) supports loading source maps\n        // we want to use the proper filename for the location as it guarantees\n        // that debugger understands and loads the source code of the file where\n        // the worklet is defined.\n        workletFun = global.evalWithSourceMap(\n          '(' + initData?.code + '\\n)',\n          initData?.location,\n          initData?.sourceMap\n        ) as (...args: any[]) => any;\n      } else if (global.evalWithSourceUrl) {\n        // if the runtime doesn't support loading source maps, in dev mode we\n        // can pass source url when evaluating the worklet. Now, instead of using\n        // the actual file location we use worklet hash, as it the allows us to\n        // properly symbolicate traces (see errors.ts for details)\n        workletFun = global.evalWithSourceUrl(\n          '(' + initData.code + '\\n)',\n          `worklet_${workletHash}`\n        ) as (...args: any[]) => any;\n      } else {\n        // in release we use the regular eval to save on JSI calls\n        // eslint-disable-next-line no-eval\n        workletFun = eval('(' + initData.code + '\\n)') as (\n          ...args: any[]\n        ) => any;\n      }\n      workletsCache.set(workletHash, workletFun);\n    }\n    const functionInstance = workletFun?.bind?.(objectToUnpack);\n    objectToUnpack._recur = functionInstance;\n    return functionInstance;\n  } else if (objectToUnpack.__init) {\n    let value = handleCache!.get(objectToUnpack);\n    if (value === undefined) {\n      value = objectToUnpack.__init();\n      handleCache!.set(objectToUnpack, value);\n    }\n    return value;\n  } else if (category === 'RemoteFunction') {\n    const fun = () => {\n      throw new Error(`Tried to synchronously call a non-worklet function on the UI thread.\n\nPossible solutions are:\n  a) If you want to synchronously execute this method, mark it as a worklet\n  b) If you want to execute this function on the JS thread, wrap it using \\`runOnJS\\``);\n    };\n    fun.__remoteFunction = objectToUnpack;\n    return fun;\n  } else {\n    throw new Error('data type not recognized by unpack method');\n  }\n}\n\nfunction setupRequestAnimationFrame() {\n  'worklet';\n\n  // Jest mocks requestAnimationFrame API and it does not like if that mock gets overridden\n  // so we avoid doing requestAnimationFrame batching in Jest environment.\n  const nativeRequestAnimationFrame = global.requestAnimationFrame;\n\n  let animationFrameCallbacks: Array<(timestamp: number) => void> = [];\n  let lastNativeAnimationFrameTimestamp = -1;\n\n  global.__flushAnimationFrame = (frameTimestamp: number) => {\n    const currentCallbacks = animationFrameCallbacks;\n    animationFrameCallbacks = [];\n    currentCallbacks.forEach((f) => f(frameTimestamp));\n    flushImmediates();\n  };\n\n  global.requestAnimationFrame = (\n    callback: (timestamp: number) => void\n  ): number => {\n    animationFrameCallbacks.push(callback);\n    if (animationFrameCallbacks.length === 1) {\n      // We schedule native requestAnimationFrame only when the first callback\n      // is added and then use it to execute all the enqueued callbacks. Once\n      // the callbacks are run, we clear the array.\n      nativeRequestAnimationFrame((timestamp) => {\n        if (lastNativeAnimationFrameTimestamp >= timestamp) {\n          // Make sure we only execute the callbacks once for a given frame\n          return;\n        }\n        lastNativeAnimationFrameTimestamp = timestamp;\n        global.__frameTimestamp = timestamp;\n        global.__flushAnimationFrame(timestamp);\n        global.__frameTimestamp = undefined;\n      });\n    }\n    // Reanimated currently does not support cancelling callbacks requested with\n    // requestAnimationFrame. We return -1 as identifier which isn't in line\n    // with the spec but it should give users better clue in case they actually\n    // attempt to store the value returned from rAF and use it for cancelling.\n    return -1;\n  };\n}\n\nexport function initializeUIRuntime() {\n  NativeReanimatedModule.installCoreFunctions(callGuardDEV, valueUnpacker);\n\n  const IS_JEST = isJest();\n\n  if (IS_JEST) {\n    // requestAnimationFrame react-native jest's setup is incorrect as it polyfills\n    // the method directly using setTimeout, therefore the callback doesn't get the\n    // expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/jest/setup.js#L28\n    // We override this setup here to make sure that callbacks get the proper timestamps\n    // when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame\n    // @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number\n    global.requestAnimationFrame = (callback: (timestamp: number) => void) => {\n      return setTimeout(() => callback(performance.now()), 0);\n    };\n  }\n\n  const capturableConsole = console;\n  runOnUIImmediately(() => {\n    'worklet';\n    // setup error handler\n    global.ErrorUtils = {\n      reportFatalError: (error: Error) => {\n        runOnJS(reportFatalErrorOnJS)({\n          message: error.message,\n          stack: error.stack,\n        });\n      },\n    };\n\n    // setup console\n    // @ts-ignore TypeScript doesn't like that there are missing methods in console object, but we don't provide all the methods for the UI runtime console version\n    global.console = {\n      debug: runOnJS(capturableConsole.debug),\n      log: runOnJS(capturableConsole.log),\n      warn: runOnJS(capturableConsole.warn),\n      error: runOnJS(capturableConsole.error),\n      info: runOnJS(capturableConsole.info),\n    };\n\n    if (!IS_JEST) {\n      setupSetImmediate();\n      setupRequestAnimationFrame();\n    }\n  })();\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAOA;AACA,SAASA,YAAT,CACEC,EADF,EAGQ;EACN;;EADM,kCADHC,IACG;IADHA,IACG;EAAA;;EAEN,IAAI;IACFD,EAAE,CA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AAM,CAAC2D,OAAP,GAAiB;MACfO,KAAK,EAAE,IAAAJ,gBAAA,EAAQJ,iBAAiB,CAACQ,KAA1B,CADQ;MAEfC,GAAG,EAAE,IAAAL,gBAAA,EAAQJ,iBAAiB,CAACS,GAA1B,CAFU;MAGfC,IAAI,EAAE,IAAAN,gBAAA,EAAQJ,iBAAiB,CAACU,IAA1B,CAHS;MAIfP,KAAK,EAAE,IAAAC,gBAAA,EAAQJ,iBAAiB,CAACG,KAA1B,CAJQ;MAKfQ,IAAI,EAAE,IAAAP,gBAAA,EAAQJ,iBAAiB,CAACW,IAA1B;IALS,CAAjB;;IAQA,IAAI,CAAChB,OAAL,EAAc;MACZ,IAAAiB,0BAAA;MACApC,0BAA0B;IAC3B;EACF,CA1BD;AA2BD"}
diff --git a/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js b/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js
index 841a948..7827520 100644
--- a/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js
+++ b/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js
@@ -46,23 +46,23 @@ function valueUnpacker(objectToUnpack, category) {
         // we want to use the proper filename for the location as it guarantees
         // that debugger understands and loads the source code of the file where
         // the worklet is defined.
-        workletFun = global.evalWithSourceMap('(' + initData.code + '\n)', initData.location, initData.sourceMap);
+        workletFun = global.evalWithSourceMap('(' + initData?.code + '\n)', initData?.location, initData?.sourceMap);
       } else if (global.evalWithSourceUrl) {
         // if the runtime doesn't support loading source maps, in dev mode we
         // can pass source url when evaluating the worklet. Now, instead of using
         // the actual file location we use worklet hash, as it the allows us to
         // properly symbolicate traces (see errors.ts for details)
-        workletFun = global.evalWithSourceUrl('(' + initData.code + '\n)', `worklet_${workletHash}`);
+        workletFun = global.evalWithSourceUrl('(' + initData?.code + '\n)', `worklet_${workletHash}`);
       } else {
         // in release we use the regular eval to save on JSI calls
         // eslint-disable-next-line no-eval
-        workletFun = eval('(' + initData.code + '\n)');
+        workletFun = eval('(' + initData?.code + '\n)');
       }

       workletsCache.set(workletHash, workletFun);
     }

-    const functionInstance = workletFun.bind(objectToUnpack);
+    const functionInstance = workletFun?.bind?.(objectToUnpack);
     objectToUnpack._recur = functionInstance;
     return functionInstance;
   } else if (objectToUnpack.__init) {
diff --git a/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js.map b/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js.map
index 7e94f9d..a7b67c2 100644
--- a/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js.map
+++ b/node_modules/react-native-reanimated/lib/module/reanimated2/initializers.js.map
@@ -1 +1 @@
-{"version":3,"names":["reportFatalErrorOnJS","NativeReanimatedModule","isJest","runOnJS","setupSetImmediate","flushImmediates","runOnUIImmediately","callGuardDEV","fn","args","e","global","ErrorUtils","reportFatalError","valueUnpacker","objectToUnpack","category","workletsCache","__workletsCache","handleCache","__handleCache","undefined","Map","WeakMap","workletHash","__workletHash","workletFun","get","initData","__initData","evalWithSourceMap","code","location","sourceMap","evalWithSourceUrl","eval","set","functionInstance","bind","_recur","__init","value","fun","Error","__remoteFunction","setupRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","animationFrameCallbacks","lastNativeAnimationFrameTimestamp","__flushAnimationFrame","frameTimestamp","currentCallbacks","forEach","f","callback","push","length","timestamp","__frameTimestamp","initializeUIRuntime","installCoreFunctions","IS_JEST","setTimeout","performance","now","capturableConsole","console","error","message","stack","debug","log","warn","info"],"sources":["initializers.ts"],"sourcesContent":["import { reportFatalErrorOnJS } from './errors';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { isJest } from './PlatformChecker';\nimport {\n  runOnJS,\n  setupSetImmediate,\n  flushImmediates,\n  runOnUIImmediately,\n} from './threads';\n\n// callGuard is only used with debug builds\nfunction callGuardDEV<T extends Array<any>, U>(\n  fn: (...args: T) => U,\n  ...args: T\n): void {\n  'worklet';\n  try {\n    fn(...args);\n  } catch (e) {\n    if (global.ErrorUtils) {\n      global.ErrorUtils.reportFatalError(e as Error);\n    } else {\n      throw e;\n    }\n  }\n}\n\nfunction valueUnpacker(objectToUnpack: any, category?: string): any {\n  'worklet';\n  let workletsCache = global.__workletsCache;\n  let handleCache = global.__handleCache;\n  if (workletsCache === undefined) {\n    // init\n    workletsCache = global.__workletsCache = new Map();\n    handleCache = global.__handleCache = new WeakMap();\n  }\n  const workletHash = objectToUnpack.__workletHash;\n  if (workletHash !== undefined) {\n    let workletFun = workletsCache.get(workletHash);\n    if (workletFun === undefined) {\n      const initData = objectToUnpack.__initData;\n      if (global.evalWithSourceMap) {\n        // if the runtime (hermes only for now) supports loading source maps\n        // we want to use the proper filename for the location as it guarantees\n        // that debugger understands and loads the source code of the file where\n        // the worklet is defined.\n        workletFun = global.evalWithSourceMap(\n          '(' + initData.code + '\\n)',\n          initData.location,\n          initData.sourceMap\n        ) as (...args: any[]) => any;\n      } else if (global.evalWithSourceUrl) {\n        // if the runtime doesn't support loading source maps, in dev mode we\n        // can pass source url when evaluating the worklet. Now, instead of using\n        // the actual file location we use worklet hash, as it the allows us to\n        // properly symbolicate traces (see errors.ts for details)\n        workletFun = global.evalWithSourceUrl(\n          '(' + initData.code + '\\n)',\n          `worklet_${workletHash}`\n        ) as (...args: any[]) => any;\n      } else {\n        // in release we use the regular eval to save on JSI calls\n        // eslint-disable-next-line no-eval\n        workletFun = eval('(' + initData.code + '\\n)') as (\n          ...args: any[]\n        ) => any;\n      }\n      workletsCache.set(workletHash, workletFun);\n    }\n    const functionInstance = workletFun.bind(objectToUnpack);\n    objectToUnpack._recur = functionInstance;\n    return functionInstance;\n  } else if (objectToUnpack.__init) {\n    let value = handleCache!.get(objectToUnpack);\n    if (value === undefined) {\n      value = objectToUnpack.__init();\n      handleCache!.set(objectToUnpack, value);\n    }\n    return value;\n  } else if (category === 'RemoteFunction') {\n    const fun = () => {\n      throw new Error(`Tried to synchronously call a non-worklet function on the UI thread.\n\nPossible solutions are:\n  a) If you want to synchronously execute this method, mark it as a worklet\n  b) If you want to execute this function on the JS thread, wrap it using \\`runOnJS\\``);\n    };\n    fun.__remoteFunction = objectToUnpack;\n    return fun;\n  } else {\n    throw new Error('data type not recognized by unpack method');\n  }\n}\n\nfunction setupRequestAnimationFrame() {\n  'worklet';\n\n  // Jest mocks requestAnimationFrame API and it does not like if that mock gets overridden\n  // so we avoid doing requestAnimationFrame batching in Jest environment.\n  const nativeRequestAnimationFrame = global.requestAnimationFrame;\n\n  let animationFrameCallbacks: Array<(timestamp: number) => void> = [];\n  let lastNativeAnimationFrameTimestamp = -1;\n\n  global.__flushAnimationFrame = (frameTimestamp: number) => {\n    const currentCallbacks = animationFrameCallbacks;\n    animationFrameCallbacks = [];\n    currentCallbacks.forEach((f) => f(frameTimestamp));\n    flushImmediates();\n  };\n\n  global.requestAnimationFrame = (\n    callback: (timestamp: number) => void\n  ): number => {\n    animationFrameCallbacks.push(callback);\n    if (animationFrameCallbacks.length === 1) {\n      // We schedule native requestAnimationFrame only when the first callback\n      // is added and then use it to execute all the enqueued callbacks. Once\n      // the callbacks are run, we clear the array.\n      nativeRequestAnimationFrame((timestamp) => {\n        if (lastNativeAnimationFrameTimestamp >= timestamp) {\n          // Make sure we only execute the callbacks once for a given frame\n          return;\n        }\n        lastNativeAnimationFrameTimestamp = timestamp;\n        global.__frameTimestamp = timestamp;\n        global.__flushAnimationFrame(timestamp);\n        global.__frameTimestamp = undefined;\n      });\n    }\n    // Reanimated currently does not support cancelling callbacks requested with\n    // requestAnimationFrame. We return -1 as identifier which isn't in line\n    // with the spec but it should give users better clue in case they actually\n    // attempt to store the value returned from rAF and use it for cancelling.\n    return -1;\n  };\n}\n\nexport function initializeUIRuntime() {\n  NativeReanimatedModule.installCoreFunctions(callGuardDEV, valueUnpacker);\n\n  const IS_JEST = isJest();\n\n  if (IS_JEST) {\n    // requestAnimationFrame react-native jest's setup is incorrect as it polyfills\n    // the method directly using setTimeout, therefore the callback doesn't get the\n    // expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/jest/setup.js#L28\n    // We override this setup here to make sure that callbacks get the proper timestamps\n    // when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame\n    // @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number\n    global.requestAnimationFrame = (callback: (timestamp: number) => void) => {\n      return setTimeout(() => callback(performance.now()), 0);\n    };\n  }\n\n  const capturableConsole = console;\n  runOnUIImmediately(() => {\n    'worklet';\n    // setup error handler\n    global.ErrorUtils = {\n      reportFatalError: (error: Error) => {\n        runOnJS(reportFatalErrorOnJS)({\n          message: error.message,\n          stack: error.stack,\n        });\n      },\n    };\n\n    // setup console\n    // @ts-ignore TypeScript doesn't like that there are missing methods in console object, but we don't provide all the methods for the UI runtime console version\n    global.console = {\n      debug: runOnJS(capturableConsole.debug),\n      log: runOnJS(capturableConsole.log),\n      warn: runOnJS(capturableConsole.warn),\n      error: runOnJS(capturableConsole.error),\n      info: runOnJS(capturableConsole.info),\n    };\n\n    if (!IS_JEST) {\n      setupSetImmediate();\n      setupRequestAnimationFrame();\n    }\n  })();\n}\n"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,UAArC;AACA,OAAOC,sBAAP,MAAmC,oBAAnC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SACEC,OADF,EAEEC,iBAFF,EAGEC,eAHF,EAIEC,kBAJF,QAKO,WALP,C,CAOA;;AACA,SAASC,YAAT,CACEC,EADF,EAGQ;EACN;;EADM,kCADHC,IACG;IADHA,IACG;EAAA;;EAEN,IAAI;IACFD,EAAE,CAAC,GAAGC,IAAJ,CAAF;EACD,CAFD,CAEE,OAAOC,CAAP,EAAU;IACV,IAAIC,MAAM,CAACC,UAAX,EAAuB;MACrBD,MAAM,CAACC,UAAP,CAAkBC,gBAAlB,CAAmCH,CAAnC;IACD,CAFD,MAEO;MACL,MAAMA,CAAN;IACD;EACF;AACF;;AAED,SAASI,aAAT,CAAuBC,cAAvB,EAA4CC,QAA5C,EAAoE;EAClE;;EACA,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AKfM,IAAI,EAAEvE,OAAO,CAAC+D,iBAAiB,CAACQ,IAAnB;IALE,CAAjB;;IAQA,IAAI,CAACZ,OAAL,EAAc;MACZ1D,iBAAiB;MACjByC,0BAA0B;IAC3B;EACF,CA1BiB,CAAlB;AA2BD"}
\ No newline at end of file
+{"version":3,"names":["reportFatalErrorOnJS","NativeReanimatedModule","isJest","runOnJS","setupSetImmediate","flushImmediates","runOnUIImmediately","callGuardDEV","fn","args","e","global","ErrorUtils","reportFatalError","valueUnpacker","objectToUnpack","category","workletsCache","__workletsCache","handleCache","__handleCache","undefined","Map","WeakMap","workletHash","__workletHash","workletFun","get","initData","__initData","evalWithSourceMap","code","location","sourceMap","evalWithSourceUrl","eval","set","functionInstance","bind","_recur","__init","value","fun","Error","__remoteFunction","setupRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","animationFrameCallbacks","lastNativeAnimationFrameTimestamp","__flushAnimationFrame","frameTimestamp","currentCallbacks","forEach","f","callback","push","length","timestamp","__frameTimestamp","initializeUIRuntime","installCoreFunctions","IS_JEST","setTimeout","performance","now","capturableConsole","console","error","message","stack","debug","log","warn","info"],"sources":["initializers.ts"],"sourcesContent":["import { reportFatalErrorOnJS } from './errors';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { isJest } from './PlatformChecker';\nimport {\n  runOnJS,\n  setupSetImmediate,\n  flushImmediates,\n  runOnUIImmediately,\n} from './threads';\n\n// callGuard is only used with debug builds\nfunction callGuardDEV<T extends Array<any>, U>(\n  fn: (...args: T) => U,\n  ...args: T\n): void {\n  'worklet';\n  try {\n    fn(...args);\n  } catch (e) {\n    if (global.ErrorUtils) {\n      global.ErrorUtils.reportFatalError(e as Error);\n    } else {\n      throw e;\n    }\n  }\n}\n\nfunction valueUnpacker(objectToUnpack: any, category?: string): any {\n  'worklet';\n  let workletsCache = global.__workletsCache;\n  let handleCache = global.__handleCache;\n  if (workletsCache === undefined) {\n    // init\n    workletsCache = global.__workletsCache = new Map();\n    handleCache = global.__handleCache = new WeakMap();\n  }\n  const workletHash = objectToUnpack.__workletHash;\n  if (workletHash !== undefined) {\n    let workletFun = workletsCache.get(workletHash);\n    if (workletFun === undefined) {\n      const initData = objectToUnpack.__initData;\n      if (global.evalWithSourceMap) {\n        // if the runtime (hermes only for now) supports loading source maps\n        // we want to use the proper filename for the location as it guarantees\n        // that debugger understands and loads the source code of the file where\n        // the worklet is defined.\n        workletFun = global.evalWithSourceMap(\n          '(' + initData?.code + '\\n)',\n          initData?.location,\n          initData?.sourceMap\n        ) as (...args: any[]) => any;\n      } else if (global.evalWithSourceUrl) {\n        // if the runtime doesn't support loading source maps, in dev mode we\n        // can pass source url when evaluating the worklet. Now, instead of using\n        // the actual file location we use worklet hash, as it the allows us to\n        // properly symbolicate traces (see errors.ts for details)\n        workletFun = global.evalWithSourceUrl(\n          '(' + initData.code + '\\n)',\n          `worklet_${workletHash}`\n        ) as (...args: any[]) => any;\n      } else {\n        // in release we use the regular eval to save on JSI calls\n        // eslint-disable-next-line no-eval\n        workletFun = eval('(' + initData.code + '\\n)') as (\n          ...args: any[]\n        ) => any;\n      }\n      workletsCache.set(workletHash, workletFun);\n    }\n    const functionInstance = workletFun?.bind?.(objectToUnpack);\n    objectToUnpack._recur = functionInstance;\n    return functionInstance;\n  } else if (objectToUnpack.__init) {\n    let value = handleCache!.get(objectToUnpack);\n    if (value === undefined) {\n      value = objectToUnpack.__init();\n      handleCache!.set(objectToUnpack, value);\n    }\n    return value;\n  } else if (category === 'RemoteFunction') {\n    const fun = () => {\n      throw new Error(`Tried to synchronously call a non-worklet function on the UI thread.\n\nPossible solutions are:\n  a) If you want to synchronously execute this method, mark it as a worklet\n  b) If you want to execute this function on the JS thread, wrap it using \\`runOnJS\\``);\n    };\n    fun.__remoteFunction = objectToUnpack;\n    return fun;\n  } else {\n    throw new Error('data type not recognized by unpack method');\n  }\n}\n\nfunction setupRequestAnimationFrame() {\n  'worklet';\n\n  // Jest mocks requestAnimationFrame API and it does not like if that mock gets overridden\n  // so we avoid doing requestAnimationFrame batching in Jest environment.\n  const nativeRequestAnimationFrame = global.requestAnimationFrame;\n\n  let animationFrameCallbacks: Array<(timestamp: number) => void> = [];\n  let lastNativeAnimationFrameTimestamp = -1;\n\n  global.__flushAnimationFrame = (frameTimestamp: number) => {\n    const currentCallbacks = animationFrameCallbacks;\n    animationFrameCallbacks = [];\n    currentCallbacks.forEach((f) => f(frameTimestamp));\n    flushImmediates();\n  };\n\n  global.requestAnimationFrame = (\n    callback: (timestamp: number) => void\n  ): number => {\n    animationFrameCallbacks.push(callback);\n    if (animationFrameCallbacks.length === 1) {\n      // We schedule native requestAnimationFrame only when the first callback\n      // is added and then use it to execute all the enqueued callbacks. Once\n      // the callbacks are run, we clear the array.\n      nativeRequestAnimationFrame((timestamp) => {\n        if (lastNativeAnimationFrameTimestamp >= timestamp) {\n          // Make sure we only execute the callbacks once for a given frame\n          return;\n        }\n        lastNativeAnimationFrameTimestamp = timestamp;\n        global.__frameTimestamp = timestamp;\n        global.__flushAnimationFrame(timestamp);\n        global.__frameTimestamp = undefined;\n      });\n    }\n    // Reanimated currently does not support cancelling callbacks requested with\n    // requestAnimationFrame. We return -1 as identifier which isn't in line\n    // with the spec but it should give users better clue in case they actually\n    // attempt to store the value returned from rAF and use it for cancelling.\n    return -1;\n  };\n}\n\nexport function initializeUIRuntime() {\n  NativeReanimatedModule.installCoreFunctions(callGuardDEV, valueUnpacker);\n\n  const IS_JEST = isJest();\n\n  if (IS_JEST) {\n    // requestAnimationFrame react-native jest's setup is incorrect as it polyfills\n    // the method directly using setTimeout, therefore the callback doesn't get the\n    // expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/jest/setup.js#L28\n    // We override this setup here to make sure that callbacks get the proper timestamps\n    // when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame\n    // @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number\n    global.requestAnimationFrame = (callback: (timestamp: number) => void) => {\n      return setTimeout(() => callback(performance.now()), 0);\n    };\n  }\n\n  const capturableConsole = console;\n  runOnUIImmediately(() => {\n    'worklet';\n    // setup error handler\n    global.ErrorUtils = {\n      reportFatalError: (error: Error) => {\n        runOnJS(reportFatalErrorOnJS)({\n          message: error.message,\n          stack: error.stack,\n        });\n      },\n    };\n\n    // setup console\n    // @ts-ignore TypeScript doesn't like that there are missing methods in console object, but we don't provide all the methods for the UI runtime console version\n    global.console = {\n      debug: runOnJS(capturableConsole.debug),\n      log: runOnJS(capturableConsole.log),\n      warn: runOnJS(capturableConsole.warn),\n      error: runOnJS(capturableConsole.error),\n      info: runOnJS(capturableConsole.info),\n    };\n\n    if (!IS_JEST) {\n      setupSetImmediate();\n      setupRequestAnimationFrame();\n    }\n  })();\n}\n"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,UAArC;AACA,OAAOC,sBAAP,MAAmC,oBAAnC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SACEC,OADF,EAEEC,iBAFF,EAGEC,eAHF,EAIEC,kBAJF,QAKO,WALP,C,CAOA;;AACA,SAASC,YAAT,CACEC,EADF,EAGQ;EACN;;EADM,kCADHC,IACG;IADHA,IACG;EAAA;;EAEN,IAAI;IACFD,EAAE,CAAC,GAAGC,IAAJ,CAAF;EACD,CAFD,CAEE,OAAOC,CAAP,EAAU;IACV,IAAIC,MAAM,CAACC,UAAX,EAAuB;MACrBD,MAAM,CAACC,UAAP,CAAkBC,gBAAlB,CAAmCH,CAAnC;IACD,CAFD,MAEO;MACL,MAAMA,CAAN;IACD;EACF;AACF;;AAED,SAASI,aAAT,CAAuBC,cAAvB,EAA4CC,QAA5C,EAAoE;EAClE;;EACA,IAAIC,aAAa,GAAGN,MAAM,CAACO,eAA3B;EACA,IAAIC,WAAW,GAAGR,MAAM,CAACS,aAAzB;;EACA,IAAIH,aAAa,KAAKI,SAAtB,EAAiC;IAC/B;IACAJ,aAAa,GAAGN,MAAM,CAACO,eAAP,GAAyB,IAAII,GAAJ,EAAz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src/reanimated2/initializers.ts b/node_modules/react-native-reanimated/src/reanimated2/initializers.ts
index 2c82793..bc155e8 100644
--- a/node_modules/react-native-reanimated/src/reanimated2/initializers.ts
+++ b/node_modules/react-native-reanimated/src/reanimated2/initializers.ts
@@ -45,7 +45,7 @@ function valueUnpacker(objectToUnpack: any, category?: string): any {
         // that debugger understands and loads the source code of the file where
         // the worklet is defined.
         workletFun = global.evalWithSourceMap(
-          '(' + initData.code + '\n)',
+          '(' + initData?.code + '\n)',
           initData.location,
           initData.sourceMap
         ) as (...args: any[]) => any;
@@ -55,19 +55,19 @@ function valueUnpacker(objectToUnpack: any, category?: string): any {
         // the actual file location we use worklet hash, as it the allows us to
         // properly symbolicate traces (see errors.ts for details)
         workletFun = global.evalWithSourceUrl(
-          '(' + initData.code + '\n)',
+          '(' + initData?.code + '\n)',
           `worklet_${workletHash}`
         ) as (...args: any[]) => any;
       } else {
         // in release we use the regular eval to save on JSI calls
         // eslint-disable-next-line no-eval
-        workletFun = eval('(' + initData.code + '\n)') as (
+        workletFun = eval('(' + initData?.code + '\n)') as (
           ...args: any[]
         ) => any;
       }
       workletsCache.set(workletHash, workletFun);
     }
-    const functionInstance = workletFun.bind(objectToUnpack);
+    const functionInstance = workletFun?.bind?.(objectToUnpack);
     objectToUnpack._recur = functionInstance;
     return functionInstance;
   } else if (objectToUnpack.__init) {
piaskowyk commented 1 year ago

Fixed with https://github.com/software-mansion/react-native-reanimated/pull/4239, the fix is available since 3.+ versions πŸš€

seba1342 commented 1 year ago

@piaskowyk thanks for your awesome fix, is there any plan to get this fix back-ported into v2?

piaskowyk commented 1 year ago

We have limited capacity unfortunately πŸ˜• So it is hard to maintain two branches of versions. I really recommend an update to Reanimated 3 because is much more stable than Rea 2.

seba1342 commented 1 year ago

We have limited capacity unfortunately πŸ˜• So it is hard to maintain two branches of versions. I really recommend an update to Reanimated 3 because is much more stable than Rea 2.

Appreciate all the work you do. We are working towards v3 right now. Thank you.

piaskowyk commented 1 year ago

Thank you for understanding 😊

salzhrani commented 1 year ago

Tools like expo doctor still recommend v2. Maybe upgrading the version there will improve adoption @piaskowyk

Kief5555 commented 1 year ago

Hello. seems to be an issue here