Repository navigation
Tested with a rust lib and here are my findings #209
Copy link
Copy link
Closed
Description
I know currently certain functions are still in development, but still went ahead and tried it out. Currently it seems like it gets stuck by napi_get_element. But below i've also logged all the napi functions this lib uses, as it might be useful. Note I didn't use the feric cli to generate everything from rust.
Here is the link to my fork if that helps: https://github.com/ronickg/react-native-node-api
NapiHost: Failed to load library 'lib-react-native-node-api-rn-chia-wallet-sdk--chia-wallet-sdk.so': dlopen failed: cannot locate symbol "napi_get_element
U napi_call_function
U napi_call_threadsafe_function
U napi_coerce_to_string
U napi_create_array_with_length
U napi_create_bigint_words
U napi_create_buffer
U napi_create_buffer_copy
U napi_create_double
U napi_create_error
U napi_create_external_buffer
U napi_create_function
U napi_create_int32
U napi_create_object
U napi_create_promise
U napi_create_reference
U napi_create_string_utf8
U napi_create_threadsafe_function
U napi_create_uint32
U napi_define_class
U napi_delete_reference
U napi_get_and_clear_last_exception
U napi_get_array_length
U napi_get_boolean
U napi_get_cb_info
U napi_get_element
U napi_get_global
U napi_get_named_property
U napi_get_null
U napi_get_reference_value
U napi_get_typedarray_info
U napi_get_undefined
U napi_get_value_bigint_words
U napi_get_value_bool
U napi_get_value_double
U napi_get_value_int32
U napi_get_value_string_utf8
U napi_get_value_uint32
U napi_instanceof
U napi_is_array
U napi_is_error
U napi_is_exception_pending
U napi_is_typedarray
U napi_new_instance
U napi_reference_unref
000000000071ca44 T napi_register_module_v1
U napi_reject_deferred
U napi_release_threadsafe_function
U napi_resolve_deferred
U napi_set_element
U napi_set_named_property
U napi_throw
U napi_throw_error
U napi_typeof
U napi_unref_threadsafe_function
U napi_unwrap
U napi_wrap
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
kraenhansen commentedon Jul 29, 2025
First of all, thank your early interest, your early experiments and for sharing your progress!
Interesting 🤔
napi_get_elementshould already be implemented in the Hermes PR. Can you share a bit on how this is failing? Are you seeing build or runtime errors?The work on the "threadsafe functions" are in progress, so you'll definitely be blocked on those until they land.
ronickg commentedon Jul 29, 2025
@kraenhansen It happens at runtime when loading the lib. And then the importeted object is undefined, when comparing against ferric-example for instance. I can probably test with a subset of the functions and see if i get it to run.
Here one can see where its being called and showing the
Failed to load librarymessage:shirakaba commentedon Jul 29, 2025
Just to be sure, do you still get the error if you load the library unconditionally in the entrypoint of your app (
index.jsor whatever) rather than a hook?Trying to rule out whether React Strict Mode or HMR or something else is causing the hook to evaluate twice and thus run
require()twice, giving a misleading error. I'd hope that requiring twice is fine anyway, but just curious to check.ronickg commentedon Jul 29, 2025
Was able to get the library to load now, was missing linking
weak-node-api: But now get this crash which I assume i cause of the napi_create_threadsafe_function: