-
Notifications
You must be signed in to change notification settings - Fork 38
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
crash on iOS 11 #88
Comments
Under RN asm.js is used as a fallback - https://github.com/polkadot-js/wasm/blob/master/packages/wasm-crypto/package.json#L17-L19 As long as the builder does not override the bundler the fallback should be in place. Some functionality like sr25519 (the Substrate-suggested crypto) is only available in WASM. |
But it doesn't seem to work, because it still crashes. |
Crashes only on iOS 11, not on other versions. similar error: |
Is it possible that the crash occurred while processing a fallback?? https://github.com/polkadot-js/wasm/blob/44c62a7b3d/packages/wasm-crypto/src/js/wasm_promise.js#L13 |
I'm guessing that since WebAssembly is supported on JSC iOS Device, so it didn't fallback to ams.js. |
I don't have a quick solution atm - it is possible to override that file completely to only use the asm.js version (so it never does a fallback). I do actually plan on doing something simmilar in a future version (WIP), but I'm actually guessing here it may still fail if |
I tested that it won't crash on iOS 11 if direct fallback to ams.js. So my guess above is correct. |
From 2.0 onwards (in beta as of now), you can do the following to ensure it always takes the asm.js path on RN. In "react-native": {
"@polkadot/wasm-crypto/wasm/bytes": "@polkadot/wasm-crypto/wasm/bytes-empty"
} This basically instructs the init path to supply empty WASM bytes, which will skip that path and go into fallback immediately. By default it, regardless of platform, it will still try WASM and if it fails, will fallback to asm (if available), that doesn't change. With the above you can force it to only use asm.js in all cases. (The package already applies an |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
We have Polkadot.js integrated in react-native, but it crashes under iOS 11.
It should be that iOS 11 isn't compatible with wasm. Can we don't use wasm? Or is there a way to make it compatible?
Here is the log:
The text was updated successfully, but these errors were encountered: