Why when I build Html5 can Firefox not find the file "MyProject.html"?

on windows 8 I build from sources UE4 on D drive then I launch it,
I created a new project and when I try to launch as html5 device Firefox Nightly can’t find the file “MyProject.html”,
also MyProject.html do not exist on c or d drive.

I have similar problem. has anyone found a solution?

I’m also getting this issue, anyone have any ideas?

How did you get it to compile to HTML5 please details, help :slight_smile:

@varomix, I grabbed the master branch from github, as well as the two required and one optional zip files, put them all in the necessary folders, then generated the project files and compiled the project targeting development editor.

I did that, now twice I get the HTML5 option on the menu but is gray out can’t select it


Yup, that’s the stage I’m at as well.

I can’t even get the HTML5 option to show up. Did you install enscripten, or anything else in addition to the standard installs?

I think the only way to generate a javascript file is using visual studio. Whether someone was able to run the HTML app using the LAUNCH button?

Building HTML5 projects is supported but only under the latest version of the engine. Release 4.1 does not work well with the latest version of the Emscripten SDK (version 1.16) so you will need to use the master branch of our UnrealEngine GitHub repository: https://github.com/EpicGames/UnrealEngine

Once you’ve got that repo up and running, read our Getting Started documentation for HTML5: Sharing and Releasing Projects for Unreal Engine | Unreal Engine 5.1 Documentation

Finally, some gotchas not currently mentioned in the documentation:

  • the HTML5 option under File → Package Project does not currently work
  • you need to use UnrealFrontend to build/cook/package/deploy HTML5 projects
  • you will need to build UnrealFrontend manually via the UE4.sln file
  • you may need to rebuild the UnrealHeaderTool if you encounter an error related to ScriptGenerationPlugin when compiling the HTML5 build
  • your project will need to define a GameDefaultMap in its DefaultEngine.ini file

Once UnrealFrontend finishes building your game project, you’ll find all the HTML5 files in Engine/Binaries/HTML5 under your repo folder. Launch the html file under a 64-bit browser and enjoy!

Hmmm, I followed all those steps, and it created UE4Game.bc, UE4Game.js, and UE4Game.js.mem files in Engine/Binaries/HTML5, but still no html file. I might’ve done something wrong in the UnrealFrontend, since I’ve never used it before. Is there a particular way I should do it?

You’re almost there :slight_smile:

The final html file is generated as part of the ‘Package’ process. You’ll need to run this process from UnrealFrontend.

The general flow is going to be:

  1. Launch UnrealFrontend
  2. Switch to ‘Game Launcher’ tab
  3. Choose ‘Advanced…’ at the left
  4. Create a new profile (if one does not already exist) by clicking the ‘+’ button in the upper-right
  5. Build: Do you wish to build? (tick this checkbox)
  6. Cook: By the book (selected any maps you want to cook under the Cooked Maps group)
  7. Package: Package & store locally (fields can be blank)
  8. Deploy: Copy to device (add a new group and tick item with HTML5 icon)
  9. You can now ‘Launch’ the build process

Provided that the build compiles successfully and the cook process doesn’t throw any errors, you should find a .html (and some other data files) in the same directory as UE4Game.bc.

I’ve tried following the above instructions using the latest preview build and emscripten 1.16. Everything compiles fine and I get the necessary html file at the end. But no matter what project I try I am always confronted with the following error when running the HTML:

Runtime/CoreUObject/Public/UObject\Class.h(2354): Assertion failed: Class
ConstructObject called with a NULL class object
D:\Development\Toolkits\UnrealEngine\Src\Preview\Engine\Source\Runtime\Core\Private\Misc\OutputDevice.cpp(176): Fatal error:
Assertion failed: Class [File:Runtime/CoreUObject/Public/UObject\Class.h] [Line: 2354]
ConstructObject called with a NULL class object
[Callstack] 0x00000000

  1. Are you seeing this error in the output textarea when running the HTML page in a browser?
  2. Are you running in a 64-bit browser such as a Firefox nightly build or Chromium 64-bit?
  3. Are you running the HTML file directly from disk (file:// in the URL) or are you hosting it via a local server stack (localhost/path/to/html/file)?

If you haven’t tried hosting via a local server stack, try using XAMPP. I found that running directly from disk caused some issues that cleared up when running through a proper web-server process.

Thanks for all your help Ben :slight_smile:

I’ve got a html file now, but when I run it, it throws these errors in the console (Using the Firefox nightly build):

ReferenceError: tstart is not defined TESTHTML5.html:212
Successfully compiled asm.js code (total compilation time 40148ms; not stored in cache; 44 functions compiled slowly: (A bunch of random functions)
uncaught exception: out of memory

Also, in the UnrealFrontend, I did get this warning:

Platform.Deploy: WARNING: HTML5 does not implement Deploy...

Any ideas?

  1. Yes
  2. Yes - Firefox Nightly build
  3. Running directly from disk

I will try out XAMPP and post my results. Thanks for responding.

And success, I started with a clean engine build, fixed up an issue I had with my path pointing to python and after using frontend to compile SwingNinja project everything worked:

SwingNinja in HTML5

Just follow the instructions above carefully, I had success doing this as per my above comments.

The warning from UnrealFrontend is harmless and expected – safe to ignore.

The “out of memory” exception is usually caused by running the HTML file under a 32-bit browser. You’ll want to be certain you’re running under a 64-bit browser like a Firefox nightly (make sure to grab the x86_64 version) or Chromium 64-bit.

Glad to hear you got it up and running!