-
Notifications
You must be signed in to change notification settings - Fork 6
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
can not build #11
Comments
Hi, I just tried to install the latest version of npx create-react-native-app -t with-typescript xxx
cd xxx
yarn add react-native-webassembly axios
npx expo prebuild
cd ios && pod install
cd ..
yarn ios Then I loaded up some simple example inside import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import * as WebAssembly from 'react-native-webassembly';
import axios from 'axios';
export default function App() {
React.useEffect(() => void (async () => {
try {
const {data} = await axios({
url: 'https://github.com/torch2424/wasm-by-example/raw/master/examples/hello-world/demo/assemblyscript/hello-world.wasm',
method: 'get',
responseType: 'arraybuffer',
});
const x = await WebAssembly.instantiate<{add: (a: number, b: number) => number}>(data);
console.warn(x.instance.exports.add(1000, 2000));
} catch (e) {
console.error(e);
}
})(), []);
return (
<View style={styles.container}>
<Text>Open up App.tsx to start working on your app!</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
}); This works as expected. This may suggest a configuration issue with your project; the It could be a couple of things:
It could also be some other configuration issues, but these would be my bet. |
I use 0.69.10 with hermes enable, when installed react-native-webassembly@0.3.2, build without error, so is react-native-webassembly@0.3.3 only support 0.71.1+ ? |
Hey @iwater, sorry for the delay getting back to you. I believe this was one of those move-fast-break-things situations when we had basically zero users. Hope you were able to make the upgrade and it wasn't too painful (but hey, it's React Native). |
The text was updated successfully, but these errors were encountered: