I'm trying to make BabylonReactNative to work on macOS

Okay, I rebuilt libraries, and now this error occurs:
com.facebook.react.JavaScript (7): hit program assert at line 1123 of jsi/jsi.h.
which is:

Object getObject(Runtime& runtime) const& {
    assert(isObject());
    return Object(runtime.cloneObject(data_.pointer.ptr_));
}

and here are stack traces:

#0	0x00000001af86e868 in __pthread_kill ()
#1	0x000000010870abc4 in pthread_kill ()
#2	0x00000001af7de2c8 in abort ()
#3	0x00000001af7dd620 in __assert_rtn ()
#4	0x00000001046ea36c in facebook::jsi::Value::getObject(facebook::jsi::Runtime&) const & at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/macos/jsi/jsi/jsi.h:1123
#5	0x000000010450f600 in Napi::External<Babylon::Graphics::DeviceImpl>::Data() const at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Dependencies/napi/napi-jsi/include/napi/napi-inl.h:761
#6	0x000000010450f4c4 in Babylon::Graphics::DeviceImpl::GetFromJavaScript(Napi::Env) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Core/Graphics/Source/DeviceImpl.cpp:126
#7	0x0000000104507708 in Babylon::Graphics::DeviceContext::GetFromJavaScript(Napi::Env) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Core/Graphics/Source/DeviceContext.cpp:25
#8	0x0000000104c0eeec in Babylon::Polyfills::Internal::Window::GetDevicePixelRatio(Napi::CallbackInfo const&) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Polyfills/Window/Source/Window.cpp:122
#9	0x0000000104877b0c in Napi::details::Function<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Callback(napi_env__*, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long, void*, Napi::Value (*)(Napi::CallbackInfo const&)) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Dependencies/napi/napi-jsi/include/napi/napi-inl.h:1254
#10	0x0000000104877a5c in Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Dependencies/napi/napi-jsi/include/napi/napi-inl.h:1276
#11	0x0000000104877a08 in decltype(std::declval<Napi::Value (*)(Napi::CallbackInfo const&)>()(std::declval<facebook::jsi::Runtime&>(), std::declval<facebook::jsi::Value const&>(), std::declval<facebook::jsi::Value const*>(), std::declval<unsigned long>())) std::__1::__invoke[abi:v15006]<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(Napi::Value (*&&)(Napi::CallbackInfo const&), facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/invoke.h:394
#12	0x0000000104877990 in facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value, false>::__call<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/invoke.h:470
#13	0x0000000104877944 in std::__1::__function::__alloc_func<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long), std::__1::allocator<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()[abi:v15006](facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:185
#14	0x0000000104876914 in std::__1::__function::__func<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long), std::__1::allocator<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:359
#15	0x0000000104aec990 in std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()[abi:v15006](facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) const at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:512
#16	0x0000000104aec394 in std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:1197
#17	0x0000000104aebb90 in facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) at /Users/jihoobyeon/Desktop/foo/node_modules/react-native-macos/ReactCommon/jsi/JSCRuntime.cpp:1158
#18	0x00000001c8fcc9a0 in JSC::callJSNonFinalObjectCallbackObject(JSC::JSGlobalObject*, JSC::CallFrame*) ()
#19	0x00000001c8f293a4 in vmEntryToNative ()

It looks like env and/or GetContext it not an object. Any idea @bghgary ?

Sorry, I’m OOF and on my phone. Hard to read the log. I will look after I’m back next week if that’s okay.

2 Likes

I updated my repo as npm package - you can now just install with git URL for testing when you’re back.
yarn add https://github.com/jihoobyeon/BRN-macOS.git
yarn add https://github.com/jihoobyeon/BRN-macOS-x86_64.git (for Intel Macs)
yarn add https://github.com/jihoobyeon/BRN-macOS-arm64.git (for Apple Silicon)

Note that I reverted to AppRuntime_JSI.cpp since it seems to run on Node, which uses V8

@jihoobyeon What am I supposed to do with these packages? Install them in a clean folder or to an existing RN template? Something else?

@bghgary
You should make a React Native for macOS project and install them on it.
You can add support for macOS on new or existing RN project by npx react-native-macos-init then install my packages.

Note that they recently released ver. 0.71.x, but I haven’t tested on there - I’m still using 0.68.x
So I recommand to you to use 0.68.x version for testing my npm packages.

I tried, but I’m getting compiler error:

N/A: version "default -> v12.14.1" is not yet installed.

You need to run `nvm install default` to install and use it.

Command PhaseScriptExecution failed with a nonzero exit code

Sorry, I’m not using nvm, so I’m hard to find cause of your error.
v12.14.1 is quite old, so I don’t have a clue why my package requires it on your Mac.

I’m using Node.js LTS v18.15.0 on M1 Mac mini with macOS Ventura 13.2.1
How’s your spec?

I’m using a really old 2015 MacBookPro. I don’t see why would matter though.

Yeah, the x86_64 one should work on yours, since 2015 one supports until Monterey.
But since it’s not working, I recommand to rebuild on your Mac:

  1. Clone my fork.
  2. At terminal, navigate into Apps/Playground and do npm ci, npm run select 0.65.
  3. Return to root folder and navigate into Modules/@babylonjs/react-native-macos/macos. there will be a .xcodeproj file now.
  4. Open that Xcode project and set “Minimum deployments” to macOS 10.15.
  5. At target MachineIndependent, set “Precompile prefix Header” to No.
  6. If you are using latest Xcode, you should add -Wno-deprecated-declarations to compiler options and chage move to std::move in spirv_common.hpp.
  7. Run project with target ALL_BUILD. if alert screen appears, choose “Update and Build”. it will make binaries for both Apple Silicon(arm64) and Intel(x86_64) Macs.
  8. If it complains about line 117 in ExternalTexture_Metal.mm, commentate that line.
    And If it complains about lacking of V8JsiRuntime.h and ScriptStore.h, copy it from here and paste it.
  9. Make a npm package by replacing binaries and ReactNativeBabylon.xcodeproj of iOS version with binaries and .xcodeproj in working folder.
  10. Install made package to RN macOS project and test it.

Thanks for the instructions, but I’m not sure when I’ll have time to do all of these steps. Can you remind me what issue are we trying to solve?

I’m not sure but it seems to trying assert before Metal API has loaded.
I am trying to make a workaround to wait until Metal has fully loaded, but no luck.

Stack trace:

com.facebook.react.JavaScript (7)#0	0x000000018fd00724 in __pthread_kill ()
#1	0x00000001048e6b84 in pthread_kill ()
#2	0x000000018fc45ae8 in abort ()
#3	0x000000018fc44e44 in __assert_rtn ()
#4	0x0000000100902468 in facebook::jsi::Value::getObject(facebook::jsi::Runtime&) const & at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/macos/jsi/jsi/jsi.h:1123
#5	0x0000000100727434 in Napi::External<Babylon::Graphics::DeviceImpl>::Data() const at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Dependencies/napi/napi-jsi/include/napi/napi-inl.h:761
#6	0x00000001007272f8 in Babylon::Graphics::DeviceImpl::GetFromJavaScript(Napi::Env) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Core/Graphics/Source/DeviceImpl.cpp:127
#7	0x000000010071f53c in Babylon::Graphics::DeviceContext::GetFromJavaScript(Napi::Env) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Core/Graphics/Source/DeviceContext.cpp:25
#8	0x0000000100e26ecc in Babylon::Polyfills::Internal::Window::GetDevicePixelRatio(Napi::CallbackInfo const&) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Polyfills/Window/Source/Window.cpp:122
#9	0x0000000100a8fc08 in Napi::details::Function<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Callback(napi_env__*, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long, void*, Napi::Value (*)(Napi::CallbackInfo const&)) at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Dependencies/napi/napi-jsi/include/napi/napi-inl.h:1254
#10	0x0000000100a8fb58 in Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const at /Users/jihoobyeon/Desktop/BabylonReactNative/Modules/@babylonjs/react-native-macos/submodules/BabylonNative/Dependencies/napi/napi-jsi/include/napi/napi-inl.h:1276
#11	0x0000000100a8fb04 in decltype(std::declval<Napi::Value (*)(Napi::CallbackInfo const&)>()(std::declval<facebook::jsi::Runtime&>(), std::declval<facebook::jsi::Value const&>(), std::declval<facebook::jsi::Value const*>(), std::declval<unsigned long>())) std::__1::__invoke[abi:v15006]<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(Napi::Value (*&&)(Napi::CallbackInfo const&), facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/invoke.h:394
#12	0x0000000100a8fa8c in facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value, false>::__call<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long>(Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/invoke.h:470
#13	0x0000000100a8fa40 in std::__1::__function::__alloc_func<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long), std::__1::allocator<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()[abi:v15006](facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:185
#14	0x0000000100a8ea10 in std::__1::__function::__func<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long), std::__1::allocator<Napi::Function Napi::Function::New<Napi::Value (*)(Napi::CallbackInfo const&)>(napi_env__*, Napi::Value (*)(Napi::CallbackInfo const&), char const*, void*)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:359
#15	0x0000000100d04b64 in std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()[abi:v15006](facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) const at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:512
#16	0x0000000100d04568 in std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/function.h:1197
#17	0x0000000100d03d64 in facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::HostFunctionMetadata::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) at /Users/jihoobyeon/Desktop/foo/node_modules/react-native-macos/ReactCommon/jsi/JSCRuntime.cpp:1158
#18	0x00000001aa6141f4 in JSC::callJSNonFinalObjectCallbackObject(JSC::JSGlobalObject*, JSC::CallFrame*) ()

Console log:

2023-04-25 20:37:01.009441+0900 foo[13463:146949] [javascript] Running "foo" with {"rootTag":1,"initialProps":{}}
2023-04-25 20:37:01.009764+0900 foo[13463:146940] [connection] nw_socket_handle_socket_event [C5:1] Socket SO_ERROR [61: Connection refused]
2023-04-25 20:37:01.010047+0900 foo[13463:146954] [connection] nw_connection_get_connected_socket_block_invoke [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection
2023-04-25 20:37:01.010178+0900 foo[13463:146954] TCP Conn 0x600003355540 Failed : error 0:61 [61]
2023-04-25 20:37:01.010327+0900 foo[13463:146954] [connection] nw_connection_copy_connected_local_endpoint_block_invoke [C5] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
2023-04-25 20:37:01.010433+0900 foo[13463:146954] [connection] nw_connection_copy_connected_remote_endpoint_block_invoke [C5] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
2023-04-25 20:37:01.153647+0900 foo[13463:146949] [javascript] '@babylonjs/react-native@1.5.1 requires @babylonjs/core@^5.42.2 but version 6.0.0 is currently installed. Run \'npm install @babylonjs/core@5.42.2\' in your app\'s root directory to upgrade.'
Assertion failed: (isObject()), function getObject, file jsi.h, line 1123.

Did this line execute yet?

BabylonReactNative/BabylonNative.cpp at master · jihoobyeon/BabylonReactNative (github.com)

Hmm, It seems not.
that file is not listed on Xcode stack trace and I tried console.log(BabylonNative); in ReactNativeEngine.js which resulted {}.
it’s odd that now Metal Enabled messages are shown, but stuck at same line.

this is the console log:

2023-04-26 21:19:03.334193+0900 foo[14371:141544] [connection] nw_socket_handle_socket_event [C4:1] Socket SO_ERROR [61: Connection refused]
2023-04-26 21:19:03.334303+0900 foo[14371:141564] [javascript] Running "foo" with {"rootTag":1,"initialProps":{}}
2023-04-26 21:19:03.334336+0900 foo[14371:141570] [connection] nw_connection_get_connected_socket_block_invoke [C4] Client called nw_connection_get_connected_socket on unconnected nw_connection
2023-04-26 21:19:03.334361+0900 foo[14371:141570] TCP Conn 0x600001e715e0 Failed : error 0:61 [61]
2023-04-26 21:19:03.334814+0900 foo[14371:141570] [connection] nw_connection_copy_connected_local_endpoint_block_invoke [C4] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
2023-04-26 21:19:03.334831+0900 foo[14371:141570] [connection] nw_connection_copy_connected_remote_endpoint_block_invoke [C4] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
2023-04-26 21:19:03.497119+0900 foo[14371:141564] [javascript] {}
2023-04-26 21:19:03.497715+0900 foo[14371:141106] Metal GPU Frame Capture Enabled
Assertion failed: (isObject()), function getObject, file jsi.h, line 1123.
2023-04-26 21:19:03.497901+0900 foo[14371:141106] Metal API Validation Enabled

I think this is expected. There is no JS object called BabylonNative.

Then is there anything do you suspect?

If you are not hitting that line I mentioned earlier, Babylon Native is probably not being initialized.

So Babylon Native should have being initialized, but it didn’t.
then is there any workaround I can do something like force-initialize Babylon Native?

Unfortunately, I don’t know enough about this to answer. There may be specific things to how React Native works on macOS. If you look at the code for the Android/iOS, the ReactNativeModule class does all of the initialization. Is this class being created in your case?