cawfree / react-native-webassembly

⚛️ 🏎 WebAssembly for React Native powered by JSI.
https://twitter.com/cawfree
MIT License
292 stars 6 forks source link

Error Failed to instantiate WebAssembly with wasm module #20

Open stephane-r opened 10 months ago

stephane-r commented 10 months ago

I'm trying to use your very interesting package with an wasm module. I've try your example : everything work nice. I've try other simple wasm module, work too.

So, i've try to use an ffmpeg wasm module (what i want finally, this module work in other web app) with WebAssembly.instantiate(), but i've an error :

 ERROR  [Error: Failed to instantiate WebAssembly. (1)]

I'm not railly understand this error. Do you know if it's possible to add more logs for try to understand what is wrong ? Unfortunately, the wasm module is proprietary, so i can't share it in this issue, sorry.

Thank you for your help 🙏

cawfree commented 10 months ago

Hey @stephane-r, sorry for taking so long to get back to you.

This sounds like an issue with the .wasm file. If you don't initialize it with the exact dependencies it needs, you will not be able to mount it - the interfaces in particular require very careful consideration.

Without more detailed information, I can only really guess that this is the problem, so recommend checking out any applications which successfully manage to include the binary and see how their interface differs to how things have been configured back in your app.

If you try adding some log output to the crash, we may get an idea of where exactly it is failing.