How to load WASM in Expo (react-native) App

214 Views Asked by At

How can I load a wasm file into an expo react native app? I am using "expo": "~49.0.8"

Here is everything I have tried: I tried using Asset and useAssets from expo-assets

I tried loading it with fetch from fetch('../assets/my-wasm-file.wasm').

I also tried simply importing it like: import wasm from "my-node-module-package-that-has-a-wasm-file/path/to/wasm-file.wasm" and that didn't work either.

The last thing I tried was this packages https://github.com/cawfree/react-native-webassembly. I tried the import HelloWorld from './hello-world.wasm'; method mentioned than the axios method. The axios method seemed to get me closer to the target but I got an error saying there was an issue with hermes. I tried to disable hermes in ios/Podfile and then run pod install but it didn't work.

0

There are 0 best solutions below