Crash asserting `getValueUnpacker` while app is booting, from calling `runOnUISync`
Description
I am encountering a crash while upgrading dependencies:
- react-native : 0.85.3 => 0.86.2
- expo : 56.0.12 => 57.0.15
- react-native-reanimated: 4.3.1 => 4.5.1
- react-native-worklets": 0.8.3 => 0.10.1
I've also tried the following version pairs: (4.4.1, 0.9.2), (4.5.2, 0.11.0), (4.4.3, 0.10.1), all with the same issue.
Here is the JS thread's stack trace:
Thread 12 name:
Thread 12 Crashed:
0 libsystem_kernel.dylib 0x000000023ffa31d0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001f02e57dc pthread_kill + 268 (:-1)
2 libsystem_c.dylib 0x000000019c512fcc abort + 148 (:-1)
3 libsystem_c.dylib 0x000000019c512278 __assert_rtn + 284 (:-1)
4 Vroomlystaging 0x000000010109fd90 worklets::(anonymous namespace)::getValueUnpacker(facebook::jsi::Runtime&) + 288 (Serializable.cpp:22)
5 Vroomlystaging 0x000000010109fad4 worklets::SerializableWorklet::toJSValue(facebook::jsi::Runtime&) + 364 (Serializable.cpp:277)
6 Vroomlystaging 0x00000001010b27ac worklets::RetainingSerializable<worklets::SerializableWorklet>::toJSValue(facebook::jsi::Runtime&) + 156 (Serializable.h:68)
7 Vroomlystaging 0x000000010109decc worklets::SerializableObject::toJSValue(facebook::jsi::Runtime&) + 180 (Serializable.cpp:186)
8 Vroomlystaging 0x000000010109fac8 worklets::SerializableWorklet::toJSValue(facebook::jsi::Runtime&) + 352 (Serializable.cpp:276)
9 Vroomlystaging 0x00000001010b27ac worklets::RetainingSerializable<worklets::SerializableWorklet>::toJSValue(facebook::jsi::Runtime&) + 156 (Serializable.h:68)
10 Vroomlystaging 0x000000010109decc worklets::SerializableObject::toJSValue(facebook::jsi::Runtime&) + 180 (Serializable.cpp:186)
11 Vroomlystaging 0x000000010109fac8 worklets::SerializableWorklet::toJSValue(facebook::jsi::Runtime&) + 352 (Serializable.cpp:276)
12 Vroomlystaging 0x00000001010b27ac worklets::RetainingSerializable<worklets::SerializableWorklet>::toJSValue(facebook::jsi::Runtime&) + 156 (Serializable.h:68)
13 Vroomlystaging 0x0000000101078890 facebook::jsi::Value worklets::WorkletRuntime::runSyncWithStack<>(std::__1::shared_ptr<worklets::SerializableWorklet> const&, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<c... + 84 (WorkletRuntime.h:81)
14 Vroomlystaging 0x000000010107972c std::__1::shared_ptr<worklets::Serializable> worklets::WorkletRuntime::runSyncSerializedWithStack<>(std::__1::shared_ptr<worklets::SerializableWorklet> const&, std::__1::optional<std::__1::basic_st... + 92 (WorkletRuntime.h:120)
15 Vroomlystaging 0x00000001010795e8 worklets::(anonymous namespace)::runOnUISync(std::__1::weak_ptr<worklets::WorkletRuntime> const&, facebook::jsi::Runtime&, facebook::jsi::Value const&, std::__1::optional<std::__1::basic_string<cha... + 160 (JSIWorkletsModuleProxy.cpp:116)
16 Vroomlystaging 0x000000010107951c worklets::JSIWorkletsModuleProxy::toOptimizedObject(facebook::jsi::Runtime&) const::$_25::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const (&) [2]) const + 260 (JSIWorkletsModuleProxy.cpp:503)
17 Vroomlystaging 0x000000010107940c void worklets::jsi_utils::addMethod<2ul, worklets::JSIWorkletsModuleProxy::toOptimizedObject(facebook::jsi::Runtime&) const::$_25>(facebook::jsi::Runtime&, facebook::jsi::Object&, char const*, work... + 68 (WorkletsJSIUtils.h:195)
18 Vroomlystaging 0x00000001010793bc std::__1::__invoke_result_impl<void, void worklets::jsi_utils::addMethod<2ul, worklets::JSIWorkletsModuleProxy::toOptimizedObject(facebook::jsi::Runtime&) const::$_25>(facebook::jsi::Runtime&, face... + 72 (invoke.h:87)
19 Vroomlystaging 0x0000000101079368 facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value, false>::__call[abi:dee210106]<void worklets::jsi_utils::addMethod<2ul, worklets::JSIWorkletsModuleProxy::toOptimize... + 64 (invoke.h:334)
20 Vroomlystaging 0x000000010107931c facebook::jsi::Value std::__1::__invoke_r[abi:dee210106]<facebook::jsi::Value, void worklets::jsi_utils::addMethod<2ul, worklets::JSIWorkletsModuleProxy::toOptimizedObject(facebook::jsi::Runtime&) ... + 64 (invoke.h:348)
21 Vroomlystaging 0x000000010107908c std::__1::__function::__func<void worklets::jsi_utils::addMethod<2ul, worklets::JSIWorkletsModuleProxy::toOptimizedObject(facebook::jsi::Runtime&) const::$_25>(facebook::jsi::Runtime&, facebook::js... + 68 (function.h:174)
22 hermesvm 0x00000001072b5368 facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::HFContext::func(void*, hermes::vm::Runtime&) + 292
23 hermesvm 0x000000010742dca0 hermes::vm::Interpreter::handleCallSlowPath(hermes::vm::Runtime&, hermes::vm::PinnedHermesValue*) + 164
24 hermesvm 0x000000010742fe58 hermes::vm::CallResult<hermes::vm::HermesValue, (hermes::vm::detail::CallResultSpecialize)2> hermes::vm::Interpreter::interpretFunction<false, false>(hermes::vm::Runtime&, hermes::vm::InterpreterSt... + 8412
25 hermesvm 0x000000010750486c hermes::vm::Runtime::interpretFunctionImpl(hermes::vm::CodeBlock*) + 132
26 hermesvm 0x000000010745fac8 hermes::vm::Runtime::runBytecode(std::__1::shared_ptr<hermes::hbc::BCProviderBase>&&, hermes::vm::RuntimeModuleFlags, llvh::StringRef, hermes::vm::Handle<hermes::vm::Environment>, hermes::vm::Handl... + 1064
27 hermesvm 0x00000001072a5d10 facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::evaluatePreparedJavaScript(std::__1::shared_ptr<facebook::jsi::PreparedJavaScript const> const&) + 240
28 hermesvm 0x00000001072af260 facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::evaluateJavaScriptWithSourceMap(std::__1::shared_ptr<facebook::jsi::Buffer const> const&, std::__1::shared_ptr<facebook::jsi::Buffer cons... + 116
29 hermesvm 0x00000001072a5b28 facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::evaluateJavaScript(std::__1::shared_ptr<facebook::jsi::Buffer const> const&, std::__1::basic_string<char, std::__1::char_traits<char>, st... + 32
30 React 0x000000010b7e1508 0x10abec000 + 12539144
31 React 0x000000010b7e12a4 0x10abec000 + 12538532
32 React 0x000000010b7e1254 0x10abec000 + 12538452
33 React 0x000000010b7e1228 0x10abec000 + 12538408
34 React 0x000000010b7dfdd4 0x10abec000 + 12533204
35 React 0x000000010b732498 0x10abec000 + 11822232
36 React 0x000000010b732448 0x10abec000 + 11822152
37 React 0x000000010b752e68 0x10abec000 + 11955816
38 React 0x000000010b747a10 0x10abec000 + 11909648
39 React 0x000000010b74867c 0x10abec000 + 11912828
40 React 0x000000010b74836c 0x10abec000 + 11912044
41 React 0x000000010b751f60 0x10abec000 + 11951968
42 React 0x000000010b751f30 0x10abec000 + 11951920
43 React 0x000000010b751ee0 0x10abec000 + 11951840
44 React 0x000000010b751eb4 0x10abec000 + 11951796
45 React 0x000000010b750d4c 0x10abec000 + 11947340
46 React 0x000000010b7cf628 0x10abec000 + 12465704
47 React 0x000000010b7cdc90 0x10abec000 + 12459152
48 React 0x000000010b7cd8e0 0x10abec000 + 12458208
49 React 0x000000010b7cd830 0x10abec000 + 12458032
50 React 0x000000010b7cd7e8 0x10abec000 + 12457960
51 React 0x000000010b7cd7c4 0x10abec000 + 12457924
52 React 0x000000010b7cc504 0x10abec000 + 12453124
53 React 0x000000010ae64928 0x10abec000 + 2591016
54 React 0x000000010ae63c88 0x10abec000 + 2587784
55 React 0x000000010ae73804 0x10abec000 + 2652164
56 React 0x000000010ae63f70 0x10abec000 + 2588528
57 React 0x000000010ae692e4 0x10abec000 + 2609892
58 React 0x000000010ae69288 0x10abec000 + 2609800
59 React 0x000000010ae69240 0x10abec000 + 2609728
60 React 0x000000010ae6921c 0x10abec000 + 2609692
61 React 0x000000010ae67ed8 0x10abec000 + 2604760
62 React 0x000000010ae64928 0x10abec000 + 2591016
63 React 0x000000010ae63c88 0x10abec000 + 2587784
64 React 0x000000010ae63c5c 0x10abec000 + 2587740
65 CoreFoundation 0x000000019094cacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 (:-1)
66 CoreFoundation 0x000000019094c798 __CFRunLoopDoBlocks + 396 (:-1)
67 CoreFoundation 0x000000019094e7a0 __CFRunLoopRun + 2356 (:-1)
68 CoreFoundation 0x000000019094d54c _CFRunLoopRunSpecificWithOptions + 532 (:-1)
69 React 0x000000010b857f6c 0x10abec000 + 13025132
70 Foundation 0x000000018dc3e904 __NSThread__start__ + 732 (:-1)
71 libsystem_pthread.dylib 0x00000001f02e2438 _pthread_start + 136 (:-1)
72 libsystem_pthread.dylib 0x00000001f02de8cc thread_start + 8AI analysis suggested this might be a race condition between boot and some action calling runOnUISync. My app (still in development, opened via TestFlight) crashes at Expo's dev server / update chooser screen, before showing any screen from the actual app.
Full crashlog: crashlog.txt
Steps to reproduce
I'm sorry that the link below is bogus. Snack doesn't support the latest expo SDK versions, which is a problem since this is an upgrade-related issue. I'm hoping that the context is enough for me to get some pointers as to how to fix this.
Snack or a link to a repository
https://github.com/vroomly/docauto/
Reanimated version
4.5.1
Worklets version
0.10.1
React Native version
0.86.2
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo Dev Client
Architecture
New Architecture (Fabric renderer)
Reanimated feature flags
No
React Native release level
Stable
Build type
Debug app & dev bundle
Device
Real device
Host machine
macOS
Device model
iPhone 14 / iOS 26.6
Acknowledgements
Yes
Source: software-mansion/react-native-reanimated