-
Notifications
You must be signed in to change notification settings - Fork 15
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
WASM not parsing on iOS 14 #119
Comments
🤦♂️ I was so focused on getting the extra rust flags and the nightly version working, that I missed the obvious hint from In the end, it seems like extra flags and and nightly toolchain are not required, simply the I'll leave this here since it could be useful for reference on debugging similar issues (had another one in the past with ffmpeg.wasm and had no clue how to debug iOS Safari). In the meantime, I will open a PR with the above change, since it turned out to be so simple. |
This report on Reddit (another user) is likely also due to the same issue: https://www.reddit.com/r/Stremio/comments/1azni6e/web_app_broken_on_ios_14_purple_screen/ Same symptoms, and also on iOS 14. |
To give an update on this, I have been able to use Stremio web as a PWA added to iOS home screen flawlessly thanks to the changes above, everything works as intended. I hope this can be merged soon, as it's a very simple change and allows a whole set of devices to finally use Stremio :D For anyone wanting to run from source in the meantime, I found that you don't need to keep the web server running after adding to iOS home screen. So you can simply:
|
resolved in Stremio/stremio-core#704 |
I am on iOS 14 for jailbreak purposes, and Stremio web refuses to load. Although I am entirely unfamiliar with WASM, and with iOS Safari debugging, I spent the last 3 days trying to find any info at all on the issue. (In case it matters, I am on iOS 14.4.2 beta 2, jailbroken with unc0ver fugu14, and debugging over USB on linux with
ios-webkit-debug-proxy
andios-safari-remote-debug-kit
following the guide at https://jade.fyi/blog/debugging-ios-safari-from-linux/).Small sidenote, there seems to be a separate problem, when an exception in WASM is thrown, the exception handling itself fails too, so no useful error messages relative to the WASM issue end up in browser console, instead just
Unhandled Promise Rejection: DataCloneError: The object can not be cloned.
is shown. How I am debugging this is by enabling "All Exceptions" breakpoint in Sources tab of debug-kit, and finding the exception message in the local variables of the debugger.The actual root of the problem seems to be WASM instructions that iOS 14's Safari can't understand. Just as-is running from source, I encounter
CompileError: WebAssemly.Module doesn't parse at byte 446: invalid opcode 194, in function at index 6
. Converting to hexopcode 0xC2
and consulting https://pengowray.github.io/wasm-ops/, it appears that this is ai64.extend8_s
instruction. Usingwasm-tools
confirms this:wasm-tools parse -t stremio_core_web_bg.wasm -o stremio_core_web_bg.wat
andgrep i64.extend8_s stremio_core_web_bg.wat
gives a few results of this instruction in the assembly.Looking around for any info on how to toggle features for wasm targets in rust, I stumbled upon this: rust-lang/rust#109807. It seems that this instruction is intended to be in use by default (atleast at this time), but it is not possible to disable it. One comment in that thread however, mentions a working solution with
wasm-pack
, asstremio-core-web
uses too: rust-lang/rust#109807 (comment).Adding:
to
Cargo.toml
indeed created a.wasm
without such instructions, but instead brought another issue.Now, I get a
LinkError: import function wbg:__wbindgen_number_new must be callable
exception when Safari loads the WASM. The above comment mentioned extra rust flags, which when I tried they complained about requiring rust nightly. I tried installing that, had to delete therust-toolchain.toml
file, but still encountered the same error.I am posting this to share my progress in debugging this issue and hoping to come to a solution, which I am currently stuck on and can't seem to find more information on.
The text was updated successfully, but these errors were encountered: