Can't build to HTML5 on Mac (ARM)

I’m making a Hello World project and I’m trying tov compile it to HTML5 with Lime, but it gives me an error.

Command and Error:

USER@DEVICE HelloWorld % lime build html5
Called from lime/_internal/backend/native/NativeCFFI.hx line 632
Called from lime/system/CFFI.hx line 182
Called from lime/system/CFFI.hx line 305
Uncaught exception - Could not find lime.ndll. This file is provided with Lime's Haxelib releases,
but not via Git. Please copy it from Lime's latest Haxelib release into either
/usr/local/lib/haxe/lib/lime/8,1,3/ndll/Mac or /usr/local/lib/haxe/lib/lime/8,1,3/ndll/Mac64, as
appropriate for your system. Advanced users may run `lime rebuild cpp` instead.
Called from ? line 1
Called from CommandLineTools.hx line 1902
Called from CommandLineTools.hx line 22
Called from a C function
Called from CommandLineTools.hx line 125
Called from CommandLineTools.hx line 639
Called from lime/tools/PlatformTarget.hx line 105
Called from HTML5Platform.hx line 412
Called from lime/tools/IconHelper.hx line 66
Called from lime/tools/IconHelper.hx line 364
Called from lime/tools/ImageHelper.hx line 118
Called from lime/graphics/Image.hx line 698
Called from lime/graphics/Image.hx line 1559
Called from a C function
Called from /opt/hostedtoolcache/haxe/4.2.5/x64/std/neko/Lib.hx line 43
Uncaught exception - load.c(237) : Failed to load library : lime.ndll (dlopen(lime.ndll, 0x0001):
tried: 'lime.ndll' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlime.ndll' (no such file),
'/usr/local/lib/neko/lime.ndll' (no such file), '/usr/local/lib/lime.ndll' (mach-o file, but is an
incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')),
'/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/lime.ndll' (no such file),
'/usr/local/lib/neko/lime.ndll' (no such file), '/usr/local/lib/lime.ndll' (mach-o file, but is an
incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')),
'/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/lime.ndll' (no such file), '/usr/lib/lime.ndll'
(no such file, not in dyld cache), 'lime.ndll' (no such file))

This is a known issue. It will be fixed in the upcoming Lime 8.2. More info here, including workarounds:

1 Like

Thank you so much! :D

Edit: One more thing, when I run the index.html file on my computer, it get stuck on the loading screen. However, when I use arch -x86_64 lime test html, it works perfectly.

The difference is that lime test html5 starts a web server, and opening the file index.html directly does not. Web browsers behave differently when content comes from a web server versus from a local file. The file:/// schema is typically more restricted by web browsers, so there are often errors that you don’t get when the content comes from a server instead.

It’s common advice to always start a web server when testing JavaScript and HTML locally due to this difference in how web browsers behave. So basically, if you don’t want to use lime test html5 with OpenFL, you should still start a different web server instead.

So does that mean HTML5 HaxeFlixel games need to run on a web server?

If you want it to run in a regular web browser, yes, you need a web server. Alternatively, you could use something like Electron to package it up into an app. I haven’t tried NW.js or Tauri as alternatives to Electron, but they may work too.

So if I post it to a site like Newgrounds, it should work, right?

Also, why turn a HTML into an exe/app using Electron, if you can just make it using arch -x86_64 lime build windows or arch -x86_64 lime build mac?

Yes. Anything on the web, including Newgrounds, already uses a web server. You should be able to upload your files, and they will take care of the rest.

I don’t know. I just threw it out there as a possibility because you specifically said that you were building for the html5 target and asked if a web server is required. Electron’s different security model is one special exception where a web server would not be required. I thought I’d mention it, just in case you had some strong reason to stick with the html5 target and couldn’t use a different target.

1 Like