HTML5 build fails (black screen, crash) with latest OpenFL

Having some major trouble with the latest version of OpenFL, HTML5 is the only target I need to work, and it’s the only one that doesn’t work. Flash, Neko and android all work fine, HTML5 compiles fine, but on launch it simply displays a black screen with the following errors in the console:

SharedObject.hx:166 Uncaught TypeError: Cannot read property ‘onExit’ of null
System.hx:99 Uncaught TypeError: Cannot read property ‘windows’ of null
http://localhost:2000/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)

I’ve tried with various combinations of the webgl and legacy tag in my project.xml, clean builds every time nothing works.

Here’s what I have installed (along with the latest public version of Haxe), it is everything from a haxelib upgrade command today.

actuate: 1.7.3 1.7.5 1.8.1 1.8.5 1.8.6 [dev:C:\HaxeToolkit\actuate]
extension-locale: [1.0.1]
ganalytics: [0.0.3]
haxe-ga: 0.4.21 [0.5.2]
hxcpp: 3.0.2 3.1.39 3.1.68 3.2.102 [3.2.205] 3.2.94
hxlibc: [1.1.4]
lime-samples: 2.4.0 [2.6.0]
lime-tools: 1.2.9 1.3.0 1.4.0 1.5.4 1.5.6 [1.5.7]
lime: 0.9.4 0.9.7 1.0.0 1.0.1 2.0.1 2.0.6 2.4.1 2.4.2 2.5.0 2.8.3 [2.9.1]
openfl-html5: [1.0.5] 1.4.2-beta
openfl-locale: 1.0.0 [1.0.1]
openfl-native: 1.2.2 [1.4.0]
openfl-samples: 1.3.0 2.1.0 2.2.1 2.2.2 3.1.0 [3.3.1]
openfl-tools: [1.0.10]
openfl: 1.2.2 1.3.0 1.4.0 2.0.0 2.0.1 2.1.7 2.2.4 3.0.6 3.0.8 3.1.4 3.5.3 [3.6.1
screenManager: 0.9.0 [1.0.0]
spritesheet: [1.2.0]
swf: 1.5.2 1.7.0 1.7.6 1.8.7 2.1.6 [2.2.0]
systools: [1.1.0]

Any help would be really appreciated, I’m fairly certain my own code isn’t the issue here, since all the other targets work fine.

Gave up and downgraded haxe, and reverted to the earlier builds. Hopefully this will be fixed in future builds.

Okay, turns out older versions are not viable anymore due to the recent web spec updates denying local loading of assets, one of which (webaudio) is required by openfl. XMLHttpRequest is banned in Chrome, and my client requires the app to be loaded locally, not from server, in Chrome.

This is what I’m running into, and cannot fix:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check
soundjs.min.js:18 XMLHttpRequest cannot load file:///…/Export/html5/bin/ Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.c._isFileXHRSupported @ soundjs.min.js:18

As the link suggests the last update to this was last month, so I’m not sure if newer OpenFL builds are aware of it and have fixed it. In either case, it’s a moot point as I cannot get the latest version of OpenFL to give me anything other than a result of “black screen with no errors appearing in console”.

Any help with this, or workarounds would be really appreciated.

I’m having the same Synchronous message. It was weird because earlier today I was building to HTML5 just fine. Then I used audio once and the error started coming. I removed the audio code, and the error won’t go away now.

@pepperpunk Sorry to bring up an old thread, perhaps this is an issue with trying -Dlegacy with HTML5? There is no legacy with HTML5, “Cannot read property ‘onExit’” suggests that Lime might be missing?

@Confidant I just checked our code, I believe this comes from SoundJS, I’ve been wondering if we should switch to Howler or a custom implementation in Lime. It’s possible that this is fixed in the latest SoundJS source, could you try downloading from, and replacing the JS file manually in the export folder of your project? It might fix the warning. Thanks!

I started one more comment but forgot to send it: This only seems to happen if I open the file directly in my browser. If I view it from a web server or local server it disappears. Yes it was SoundJS complaining. Thanks Joshua!