4.8.0 HTML5 package error

Hello, I’ve been successfuly packaging my project to HTML5 in version 4.7.6, but in 4.8.0 an error occurs that actually gives me no hints
One line seems interesting: “MemoryError”
After installing new engine version I only set Python path and Emscripten path in the new HTML5 SDK settings. I didn’t change anything in the .ini file.

Here is the error log:

Packaging (HTML5): UnrealBuildTool: INFO root: (Emscripten: Running sanity checks)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: C:\Program Files\Emscripten\emscripten\1.29.0\system\lib\libc\musl\src\math\fma.c:276:22: warning: ^ has lower precedence than !=; != will be evaluated first -Wparentheses]
MainFrameActions: Packaging (HTML5): UnrealBuildTool: if (bits_lost != 1 ^ (int)(uhi.i & 1)) {
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ~~~~~~~~~~~~~~~^
MainFrameActions: Packaging (HTML5): UnrealBuildTool: C:\Program Files\Emscripten\emscripten\1.29.0\system\lib\libc\musl\src\math\fma.c:276:22: note: place parentheses around the ‘!=’ expression to silence this warning
MainFrameActions: Packaging (HTML5): UnrealBuildTool: if (bits_lost != 1 ^ (int)(uhi.i & 1)) {
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ^
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ( )
MainFrameActions: Packaging (HTML5): UnrealBuildTool: C:\Program Files\Emscripten\emscripten\1.29.0\system\lib\libc\musl\src\math\fma.c:276:22: note: place parentheses around the ^ expression to evaluate it first
MainFrameActions: Packaging (HTML5): UnrealBuildTool: if (bits_lost != 1 ^ (int)(uhi.i & 1)) {
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ^
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ( )
MainFrameActions: Packaging (HTML5): UnrealBuildTool: 1 warning generated.
MainFrameActions: Packaging (HTML5): UnrealBuildTool: WARNING root: emcc: link command line is very long, even with response file – use paths with no spaces
MainFrameActions: Packaging (HTML5): UnrealBuildTool: Traceback (most recent call last):
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0\emcc”, line 1529, in <module>
MainFrameActions: Packaging (HTML5): UnrealBuildTool: flush_js_optimizer_queue()
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0\emcc”, line 1438, in flush_js_optimizer_queue
MainFrameActions: Packaging (HTML5): UnrealBuildTool: run_passes(chunks*, ‘js_opts_’ + str(i), just_split=‘receiveJSON’ in chunks*, just_concat=‘emitJSON’ in chunks*)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0\emcc”, line 1409, in run_passes
MainFrameActions: Packaging (HTML5): UnrealBuildTool: final = shared.Building.js_optimizer(final, passes, jcache, debug_level >= 4, js_optimizer_extra_info, just_split=just_split, just_concat=just_concat)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\shared.py”, line 1637, in js_optimizer
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ret = js_optimizer.run(filename, passes, NODE_JS, jcache, debug, extra_info, just_split, just_concat)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\js_optimizer.py”, line 479, in run
MainFrameActions: Packaging (HTML5): UnrealBuildTool: return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map, extra_info, just_split, just_concat))
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools empfiles.py”, line 39, in run_and_clean
MainFrameActions: Packaging (HTML5): UnrealBuildTool: return func()
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\js_optimizer.py”, line 479, in <lambda>
MainFrameActions: Packaging (HTML5): UnrealBuildTool: return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map, extra_info, just_split, just_concat))
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\js_optimizer.py”, line 194, in run_on_js
MainFrameActions: Packaging (HTML5): UnrealBuildTool: js = open(filename).read()
MainFrameActions: Packaging (HTML5): UnrealBuildTool: MemoryError
MainFrameActions: Packaging (HTML5): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: D:\projekty\Phobos\aplikacja\projekt\Phobos\Binaries\HTML5\Phobos.js
MainFrameActions: Packaging (HTML5): UnrealBuildTool: Total build time: 346,59 seconds
MainFrameActions: Packaging (HTML5): CommandUtils.Run: Run: Took 346,7302614s to run UnrealBuildTool.exe, ExitCode=5
MainFrameActions: Packaging (HTML5): ErrorReporter.Error: ERROR: AutomationTool error: Command failed (Result:5): D:\Epic Games\4.8\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobos HTML5 Development D:\projekty\Phobos\aplikacja\projekt\Phobos\Phobos.uproject -noxge -rocket -NoHotReloadFrom
MainFrameActions: Packaging (HTML5): IDE -ignorejunk. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (HTML5): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (HTML5): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (HTML5): Program.Main: ERROR: Exception in AutomationTool: Command failed (Result:5): D:\Epic Games\4.8\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobos HTML5 Development D:\projekty\Phobos\aplikacja\projekt\Phobos\Phobos.uproject -noxge -rocket -NoHotReloadFrom
MainFrameActions: Packaging (HTML5): IDE -ignorejunk. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (HTML5): Stacktrace: w AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary2 EnvVars) MainFrameActions: Packaging (HTML5): w AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary2 EnvVars)
MainFrameActions: Packaging (HTML5): w AutomationTool.UE4Build.BuildWithUBT(String ProjectName, String TargetName, UnrealTargetPlatform TargetPlatform, String Config, String UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity, Dictionary2 EnvVars) MainFrameActions: Packaging (HTML5): w AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InForceNonUnity, Boolean InForceUnity, Dictionary2 PlatformEnvVars) MainFrameActions: Packaging (HTML5): w Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL) MainFrameActions: Packaging (HTML5): w BuildCookRun.DoBuildCookRun(ProjectParams Params) MainFrameActions: Packaging (HTML5): w BuildCommand.Execute() MainFrameActions: Packaging (HTML5): w AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary`1 Commands)
MainFrameActions: Packaging (HTML5): w AutomationTool.Automation.Process(String] CommandLine)
MainFrameActions: Packaging (HTML5): w AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (HTML5): w AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
MainFrameActions: Packaging (HTML5): w AutomationTool.Program.Main()
MainFrameActions: Packaging (HTML5): Program.Main: ERROR: Command failed (Result:5): D:\Epic Games\4.8\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobos HTML5 Development D:\projekty\Phobos\aplikacja\projekt\Phobos\Phobos.uproject -noxge -rocket -NoHotReloadFromIDE -ignorejunk. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (HTML5): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (HTML5): Program.Main: AutomationTool exiting with ExitCode=5
MainFrameActions: Packaging (HTML5): Domain_ProcessExit
MainFrameActions: Packaging (HTML5): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (HTML5): copying UAT log files…
MainFrameActions: Packaging (HTML5): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (HTML5): BUILD FAILED

Hey Kosmo,

In 4.8.0, have you tried going into the Project Settings and scrolling down to HTML5 and changing the size of the memory? This has been linked to a few memory issues I’ve seen with HTML5 packaged projects. However, I wanted to let you know that I am able to successfully package HTML5 games and check them on a simple python server. I’m using Emscripten 1.29.0.

Here is how my HTML5Engine.ini file looks:
[Audio]
AudioDeviceModuleName=HTML5Audio

[OnlineSubsystemMcp]
benabled=false

[SystemSettings]
r.setres=800x600

; These following settings have moved to the inis and can be set from the editor
; These old value are left as reference until all old code paths are removed
;[BuildSettings]
;HeapSize=1024

;[HTML5DevicesWindows]
; (64 bit)=“C:/Program Files//firefox.exe”
; (32 bit)=“C:/Program Files (x86)//firefox.exe
;Firefox (32 bit)=“C:/Program Files (x86)/Mozilla Firefox/firefox.exe”
;Firefox Aurora (32 bit)=“C:/Program Files (x86)/Aurora/firefox.exe”
;Chrome=“C:/Program Files (x86)//Chrome/Application/chrome.exe”

;all browsers on mac are 64 bit, 64 bit browsers can allocate more than 512MB of memory to around 1.5 GB.
;[HTML5DevicesMac]
;Safari=“/Applications/Safari.app/Contents/MacOS/Safari”
;Firefox=“/Applications/Firefox.app/Contents/MacOS/firefox-bin”
;Firefox (Aurora)=“/Applications/FirefoxAurora.app/Contents/MacOS/firefox-bin”

;[HTML5DevicesLinux]
;Firefox=“/usr/bin/firefox”

;[HTML5SDKPaths]
;Mac=“/path/to/emscripten/sdk”

If you have any further questions regarding the trouble you’re having with your HTML5 project, feel free to submit a new question to our AnswerHub and we’ll assist you further.

Thanks!

Hey ,

Thank you for support. I’ve checked .ini file - looks the same and I’ve changed memory heap to 4096. Unfortunately there’s still error, looks a bit different… interesting.
I’ll try with clean projects later to be sure…

MainFrameActions: Packaging (HTML5): UnrealBuildTool: INFO root: (Emscripten: Running sanity checks)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: WARNING root: emcc: link command line is very long, even with response file – use paths with no spaces
MainFrameActions: Packaging (HTML5): UnrealBuildTool: Traceback (most recent call last):
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0\emcc”, line 1529, in <module>
MainFrameActions: Packaging (HTML5): UnrealBuildTool: flush_js_optimizer_queue()
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0\emcc”, line 1438, in flush_js_optimizer_queue
MainFrameActions: Packaging (HTML5): UnrealBuildTool: run_passes(chunks*, ‘js_opts_’ + str(i), just_split=‘receiveJSON’ in chunks*, just_concat=‘emitJSON’ in chunks*)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0\emcc”, line 1409, in run_passes
MainFrameActions: Packaging (HTML5): UnrealBuildTool: final = shared.Building.js_optimizer(final, passes, jcache, debug_level >= 4, js_optimizer_extra_info, just_split=just_split, just_concat=just_concat)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\shared.py”, line 1637, in js_optimizer
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ret = js_optimizer.run(filename, passes, NODE_JS, jcache, debug, extra_info, just_split, just_concat)
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\js_optimizer.py”, line 479, in run
MainFrameActions: Packaging (HTML5): UnrealBuildTool: return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map, extra_info, just_split, just_concat))
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools empfiles.py”, line 39, in run_and_clean
MainFrameActions: Packaging (HTML5): UnrealBuildTool: return func()
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\js_optimizer.py”, line 479, in <lambda>
MainFrameActions: Packaging (HTML5): UnrealBuildTool: return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map, extra_info, just_split, just_concat))
MainFrameActions: Packaging (HTML5): UnrealBuildTool: File “C:\Program Files\Emscripten\emscripten\1.29.0 ools\js_optimizer.py”, line 194, in run_on_js
MainFrameActions: Packaging (HTML5): UnrealBuildTool: js = open(filename).read()
MainFrameActions: Packaging (HTML5): UnrealBuildTool: MemoryError
MainFrameActions: Packaging (HTML5): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (HTML5): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: D:\projekty\Phobos\aplikacja\projekt\Phobos\Binaries\HTML5\Phobos.js
MainFrameActions: Packaging (HTML5): UnrealBuildTool: Total build time: 426,38 seconds
MainFrameActions: Packaging (HTML5): CommandUtils.Run: Run: Took 426,5004665s to run UnrealBuildTool.exe, ExitCode=5
MainFrameActions: Packaging (HTML5): ErrorReporter.Error: ERROR: AutomationTool error: Command failed (Result:5): D:\Epic Games\4.8\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobos HTML5 Development D:\projekty\Phobos\aplikacja\projekt\Phobos\Phobos.uproject -noxge -rocket -NoHotReloadFrom
MainFrameActions: Packaging (HTML5): IDE -ignorejunk. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (HTML5): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (HTML5): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (HTML5): Program.Main: ERROR: Exception in AutomationTool: Command failed (Result:5): D:\Epic Games\4.8\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobos HTML5 Development D:\projekty\Phobos\aplikacja\projekt\Phobos\Phobos.uproject -noxge -rocket -NoHotReloadFrom
MainFrameActions: Packaging (HTML5): IDE -ignorejunk. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (HTML5): Stacktrace: w AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary2 EnvVars) MainFrameActions: Packaging (HTML5): w AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary2 EnvVars)
MainFrameActions: Packaging (HTML5): w AutomationTool.UE4Build.BuildWithUBT(String ProjectName, String TargetName, UnrealTargetPlatform TargetPlatform, String Config, String UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity, Dictionary2 EnvVars) MainFrameActions: Packaging (HTML5): w AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InForceNonUnity, Boolean InForceUnity, Dictionary2 PlatformEnvVars) MainFrameActions: Packaging (HTML5): w Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL) MainFrameActions: Packaging (HTML5): w BuildCookRun.DoBuildCookRun(ProjectParams Params) MainFrameActions: Packaging (HTML5): w BuildCommand.Execute() MainFrameActions: Packaging (HTML5): w AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary`1 Commands)
MainFrameActions: Packaging (HTML5): w AutomationTool.Automation.Process(String] CommandLine)
MainFrameActions: Packaging (HTML5): w AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (HTML5): w AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
MainFrameActions: Packaging (HTML5): w AutomationTool.Program.Main()
MainFrameActions: Packaging (HTML5): Program.Main: ERROR: Command failed (Result:5): D:\Epic Games\4.8\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobos HTML5 Development D:\projekty\Phobos\aplikacja\projekt\Phobos\Phobos.uproject -noxge -rocket -NoHotReloadFromIDE -ignorejunk. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (HTML5): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (HTML5): Program.Main: AutomationTool exiting with ExitCode=5
MainFrameActions: Packaging (HTML5): Domain_ProcessExit
MainFrameActions: Packaging (HTML5): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (HTML5): copying UAT log files…
MainFrameActions: Packaging (HTML5): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (HTML5): BUILD FAILED

Hey Kosmo,

Could you please try running “python embuilder.py build struct_info” in the command line? Please let me know of the outcome.

Thank you!

Hey again ,

unfortunately “python embuilder.py build struct_info” gives “python: can’t open file ‘embuilder.py’: [Errno 2] No such file or directory”

Googling it gave me no results, but I’ve found a topic where [Ankitkk] STAFF suggested using Emscripten 1.25, which actually worked perfectly! So it looks like Emscripten 1.29+ is a no no, at least on my machine (Intel Core i5, Windows 8.1 x64, 8GB RAM).
Next I’ve tested a clean C++ project on Chrome, Firefox and .

Chrome - no errors - some FPS glitching, better in fullscreen
Firefox - no errors - perfect FPS, premium class compared to Chrome
:

Error: uncaught exception: abort() at jsStackTrace@http://localhost/HTML5/HTML5Test.js:1:18192
stackTrace@http://localhost/HTML5/HTML5Test.js:1:18375
abort@http://localhost/HTML5/HTML5Test.js:242:81291
assert@http://localhost/HTML5/HTML5Test.js:1:8281
@http://localhost/HTML5/HTML5Test.js:1:19945

If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

// Edit: Mouse input didn’t work, because I’ve packaged for mobile input :smiley: my bad. Though, hidden cursor input acts weird, tiny shifts aren’t registered properly.
// Edit2: Ok hidden cursor input works as should in fullscreen mode. Best result settings:
Target Hardware: Mobile/Tablet, Scalable 3D or 2D
Input: Mouse for Touch: false (only then mouse input works on Mobile target… weird)

Desktop / Console + Maximum Quality = not really pretty, like resolution was lower and was scaled up
Desktop / Console + Scalable 3D or 2D = black screen
Mobile/Tablet + Maximum Quality = black screen

Hey Kosmo,

There is currently a report in for Emscripten 1.30, we’re hoping it’ll be corrected in 4.9 however, I can’t guarantee that. Were you able to downgrade your Emscripten to 1.25 and get your project working properly?

Thanks!

Yes, as I’ve already mentioned, downgrading to 1.25 was what let me finaly compile my project. I was also having problems with cooking… which resolved automagically after packaging for Windows 64bit… like packaging for HTML5 actually lacked some files that are created during packaging for Windows 64bit

Hey,

I wanted to verify that everything is good to go now? :slight_smile:

Hey, yes for now it is all working, thank you for the help :slight_smile: I will be testing more and more complex features in the coming days so we will see what will come up.

You’re very welcome Kosmo, please let us know if you have any further questions. We’re on AnswerHub too. :slight_smile:

So a thing came up. I’m loading a .json file through HTTP request and parsing its content. One of its fields is a string containing non-ASCII characters. Everything works fine in Editor, but in HTML5 a memory error occurrs when I try to log the string value or set it to a TextRender actor to display it in the scene. I’m keeping the non-ASCII characters value in an FString variable, there are no errors until I actually want to output it somehow… Do I need to set some encoding somehow, or store such characters in some other way?