matrix-org / matrix-js-sdk

Matrix Client-Server SDK for JavaScript
Apache License 2.0
1.49k stars 578 forks source link

Property 'FinalizationRegistry' doesn't exist #4147

Closed greynewell closed 3 months ago

greynewell commented 3 months ago

When calling client.initRustCrypto() from React Native (Expo) running on hermes engine, I always get the following output from matrix_sdk_crypto_wasm.js:

 WARN  TextEncoder constructor called with encoding label, which is ignored.
 ERROR  ReferenceError: Property 'FinalizationRegistry' doesn't exist, js engine: hermes
 ERROR  setup error: [TypeError: RustCrypto.initRustCrypto is not a function (it is undefined)]

I can't seem to find a way to polyfill FinalizationRegistry in React Native, and the regular/legacy initCrypto is also not working in this runtime. What should I do?

simulator_screenshot_722B4BFF-CCF8-4794-8079-CC8411232F44

greynewell commented 3 months ago

Upgraded to latest version and have a different error, quite possibly one I can solve. Closing.