Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting memory as [] instead of Memory instance #24

Open
ieow opened this issue Dec 1, 2023 · 5 comments
Open

getting memory as [] instead of Memory instance #24

ieow opened this issue Dec 1, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ieow
Copy link

ieow commented Dec 1, 2023

I am getting the memory as [] and memory.buffer as undefined when load in react-native (with react-native-webassembly).
I am able to get the memory as Memory instance on nodejs enviroment

I am not sure if the wasm I used is using multiple memory region.
would the multiple memory region causing this issue?

@cawfree
Copy link
Owner

cawfree commented Dec 1, 2023

Hey @ieow thanks for raising. Can you provide some example code so I could check this out?

Sounds like the buffer is likely not being initialized or exported correctly. Hard to say without more details.

@cawfree cawfree added the bug Something isn't working label Dec 1, 2023
@ieow
Copy link
Author

ieow commented Dec 2, 2023

I am trying to load this library
https://github.com/torusresearch/tss-lib-rn/tree/demo/test-rn

code to load it

      import * as TssLibNode from '@toruslabs/tss-lib-rn';
      
      await TssLibNode.init();
      
      console.log(TssLib.wasmMod.exports.memory);
      console.log(TssLib.wasmMod.exports.memory.buffer);
      console.log(TssLib.wasmMod.memory);

@cawfree
Copy link
Owner

cawfree commented Dec 2, 2023

@ieow Thanks for sharing, I'll check this out. By the way, Torus is 🔥!

@ieow
Copy link
Author

ieow commented Dec 4, 2023

Thanks for the efforts and compliment !!!

@ieow
Copy link
Author

ieow commented Dec 7, 2023

@cawfree , just check out if you found the issue.
Also I would like to point out that the wasm file is using import (global) js function.
would this might be an issue ?

https://rustwasm.github.io/wasm-bindgen/examples/import-js.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants