About Chrome and Webassembly

I tested webassembly on the Android Chrome browser. Lime/openfl/hxcpp were all the latest versions. Chrome148 had different test results on different mobile devices. It can pass the test on Android phones but cannot complete the test on Android handheld, crashes or fails to load. Firefox has passed tests on all mobile devices. So, should I give up Chrome and choose Firefox?

When saying which versions you are using, what “latest” means often not clear to anyone but yourself. It might mean that you’re using the current releases on Haxelib. It might mean that you’ve checked out the git repositories. Then there’s the fact that we’re on a forum where threads may be found on search engines for years to come, and “latest” becomes even more difficult for the reader to determine. Generally, I recommend listing the exact version numbers instead of saying “latest”.

For hxcpp, you actually may have better luck trying a nightly build from GitHub instead of the “latest” 4.3.2 version released on Haxelib. There have been tons of bug fixes to hxcpp since version 4.3.2, released over three years ago, at the time that I am writing this.

1 Like

As long as this issue persists, there is no need to specify a definite version number. Describing it as “the latest version” is the most appropriate.

I disagree. You are making it more difficult to help you. Please share the exact version numbers you are currently using. Thank you!

lime: 8.3.2

openfl: 9.5.2

hxcpp: 4.3.140

I believe the problem is caused by chrome.

Thank you! Now it is clear to me that you are not missing any known fixes for OpenFL running on webassembly.

When you say test, is it just checking if a simple project will run? A larger project? Are you running some kind of automated test suite?

Are there errors in the browser’s debug console that you can share?

What is the difference between a phone and a handheld in this context? Is a handheld a tablet? Or some other type of device? Can you share the device model names?

I’m trying to run an Away3D example on a Samsung phone, two Android handhelds (Odin2/Odin3), and a Samsung tablet. It only runs on the phone; it fails on the other devices. I’m only using “lime test webassembly” for testing; I haven’t used any other tools.

The examples run perfectly fine on Firefox.

Ah! I understand now that “handheld” in this context refers to portable gaming devices. Thanks.

Can you offer any more details about what happens when it fails? Blank page? Whole browser crashes with a segfault? Something else?

If you view the device’s browser devtools console output, are there any errors that you can share? It’s quite possible that you can’t view the browser’s console on the device itself. As I understand it, you can connect it to a computer that is also running Chrome, and then Chrome on the computer can access the device’s browser console output. This is known as remote debugging. I’ve done it in the past, but it’s been a long time.

This page seems to describe how to do it: Remote debug Android devices  |  Chrome DevTools  |  Chrome for Developers

OK, and I will report on the specifics later.

The command “lime build webassembly -final -release” resolved all the issues. Executing the command “lime test webassembly” will result in Chrome throwing a “net::err_timed_out” error.

-final and -release aren’t actually meant to be combined together (and Lime should probably report an error, but it doesn’t currently). -debug, -release and -final are all separate modes. You should choose exactly one of those three. For reference, if you don’t specify any of the three flags, it basically defaults to -release.

If you want to try each of the three modes, I recommend adding -clean when you switch from one to the other. Sometimes, the compiler seems to cache old symbols, and it can fail from a mix of debug and release symbols.

And then, sometimes, the compiler randomly seems to realize that it needs a clean build of everything without adding -clean. I suspect that might be what happened when you added -final.

Anyway, lime test webassembly -clean might give you better results (then, you should be able to remove -clean for following builds as long as you don’t switch to -debug or -final).

2 Likes

Yes, I forgot to add “-clean”, but I deleted the entire Export folder.