jsartoolkitNFT icon indicating copy to clipboard operation
jsartoolkitNFT copied to clipboard

Unhandled Promise Rejection on iOS safari

Open tortoise00q opened this issue 2 years ago • 5 comments

I just testing the multi.html in examples and I get "Unhandled Promise Rejection: RuntimeError: Aborted(CompileError: WebAssembly.Module doesn't parse at byte 272: invalid opcode 253, in function at index 75). Build with -s ASSERTIONS=1 for more info." at artoolkitNFT_wasm.js

The error only occur in iOS devices but android device run smooth.

tortoise00q avatar May 24 '22 04:05 tortoise00q

Hi @tortoise00q you are welcome, unfortunately i have no iOS devices to test so i can't help so much. Does this occur also for the other examples? What browser are you using with iOS? Lately i added the SIMD feature but Safari does not support yet it, so the examples should detect and load the non SIMD version. Maybe it is a WebAssembly issue? Can you try the asm version of the lib? Try to change https://github.com/webarkit/jsartoolkitNFT/blob/211bbaa0534e5a586722de858bb9baa9bba4dd0a/js/artoolkitNFT.multi_worker.js#L17 with: importScripts("../build/artoolkitNFT.min.js");

kalwalt avatar May 24 '22 20:05 kalwalt

I also experience the same on iOS.

"I just testing the multi.html in examples and I get "Unhandled Promise Rejection: RuntimeError: Aborted(CompileError: WebAssembly.Module doesn't parse at byte 272: invalid opcode 253, in function at index 75). Build with -s ASSERTIONS=1 for more info." at artoolkitNFT_wasm.js"

@kalwalt I've tried your last recommendation:

importScripts("../build/artoolkitNFT.min.js");

but it doesn't seem to complete loading (in any browser).

The logs in the console show a log of the video, but no NFT images load and the screen remains on the loading screen.

Any suggestions?

larrykeeler12 avatar Jan 18 '23 04:01 larrykeeler12

I also experience the same on iOS.

"I just testing the multi.html in examples and I get "Unhandled Promise Rejection: RuntimeError: Aborted(CompileError: WebAssembly.Module doesn't parse at byte 272: invalid opcode 253, in function at index 75). Build with -s ASSERTIONS=1 for more info." at artoolkitNFT_wasm.js"

@kalwalt I've tried your last recommendation:

importScripts("../build/artoolkitNFT.min.js");

but it doesn't seem to complete loading (in any browser).

The logs in the console show a log of the video, but no NFT images load and the screen remains on the loading screen.

Any suggestions?

Thank you @larrykeeler12 unfortunately i have any iOS devices to test, i can say that this at least not happens on Android ( with at least my Android devices). I'm open to find a solution but i have no idea at the moment.

kalwalt avatar Jan 18 '23 19:01 kalwalt

I have a similar issue. It may be related to usage of -mnontrapping-fptoint. I've got this idea from thi thread https://github.com/emscripten-core/emscripten/issues/9842 of emscripten-core.

Is there a workaround for this issue?

Artkoch avatar Mar 25 '23 18:03 Artkoch

Thank you @Artkoch to point me to this issue. I have no workaroud at the moment. It would be very useful to find if the Emscripten compiler add that flag or not. I will make some tests.

kalwalt avatar Mar 25 '23 22:03 kalwalt