webarkit / jsartoolkitNFT

jsartolkitNFT is a smaller version of jsartoolkit5 with only NFT support
GNU Lesser General Public License v3.0
131 stars 25 forks source link

Unhandled Promise Rejection on iOS safari #175

Open tortoise00q opened 2 years ago

tortoise00q commented 2 years ago

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.

kalwalt commented 2 years ago

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");

larrykeeler12 commented 1 year ago

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?

kalwalt commented 1 year ago

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.

Artkoch commented 1 year ago

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?

kalwalt commented 1 year ago

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.