HTML5 Chromium JavaScript Alert

I have successfully packaged my project for the HTML5 platform and it runs fine with nightly’s Firefox browser (Fine is a bit of an exaggeration haha but it runs). But when I try to open it with my Chrome browser I get a JavaScript Alert JavaScript: Error and it does not run. I tried building for shipping and development and in both instances I get the error. My project is smaller then Tappy Chicken so I’m not sure if it is memory related.

Let me know what information you need to help me understand why Chrome cannot run my project. Thank you!

If you open the JavaScript Console (in the “More Tools” menu) does that give you any more information? Or are you getting the “Aw Snap!” error?

yeah I just downloaded chromium 64 which I guess is different then Chrome? Anyway that gives me the Aw snap error.

In firefox I am getting this warning:
LogRHI: Warning: Texture 0 (Resource 94) has a non-clamp mode; switching to clamp to avoid driver problems.

Don’t know if that is relevant. My textures were not power of 2 and have no mipmaps, would that be the cause?

Inside of Google Chrome’s JavaScript Console I do get more info;

M3_Blueprint_4_7_1.html:235 Current Browser : Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
M3_Blueprint_4_7_1.html:236 We are running in 32 bit browser, clamping requested memory size of 1073741824 bytes to 536870912 bytes or use a 64 bit browser
M3_Blueprint_4_7_1.data.js:68 XMLHttpRequest cannot load file:///D:/_Projects/Match3FrameWork/Export/HTML5/M3_Blueprint_4_7_1.data. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
M3_Blueprint_4_7_1.data.js:68 Uncaught NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load ‘file:///D:/_Projects/Match3FrameWork/Export/HTML5/M3_Blueprint_4_7_1.data’.
M3_Blueprint_4_7_1.html:117 Uncaught TypeError: undefined is not a function
UE4Game.js:8758 XMLHttpRequest cannot load file:///D:/_Projects/Match3FrameWork/Export/HTML5/UE4Game.js.mem. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
UE4Game.js:5090343 Uncaught could not load memory initializer UE4Game.js.mem
UE4Game.js:8758 Uncaught NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load ‘file:///D:/_Projects/Match3FrameWork/Export/HTML5/UE4Game.js.mem’.

1 Like

I thought my project was smaller then Tappy Chicken lol But it says 536870912 bytes = 536mb right which is after clamping before its over 1k mb? I’m sure you’ll be able to better understand this then me. Thank you for taking the time to help me out.

Hmm the problem seems to be when I run locally. I hosted my project from GoogleDrive and the game successfully ran in my Chrome Browser? Weird. I get the same warning though but it runs from GoogleDrive LogRHI: Warning: Texture 0 (Resource 94) has a non-clamp mode; switching to clamp to avoid driver problems

“My textures were not power of 2 and have no mipmaps” - This won’t be the cause but I’d REALLY recommend using power of 2 textures :wink:

From the output it’s failing to find a number of paths with ‘file:///’ in them. Are you running from a web server? Opening the html will only work on firefox. Chrome and other browsers don’t allow file:///.

If you want to test locally, run a little web server and connect to localhost. If you have python installed ( you should be able to build html5 :wink: ) run the command line “python -m SimpleHTTPServer” in the directory you packaged your game too

Ah so that is why it was running fine from googledrive’s server.
What about the log warning?

And yeah the texture thing was for testing purposes, I just downloaded sample files images. I’ve already created power of 2 versions for the shipping version. Though I do wonder about this; For a 2d project which has no depths, does it really matter if there is no mipmaps?

Thanks for your help, maybe convert your last comment to an answer so that I can accept it?

Chromium still gives me the Aw snap error though, from what I gather this is because my project seems to be 32 bit and chromium is 64?

I would only worry about the warning if you start to get textures that don’t repeat correctly…and I would assume that converting those textures to power of 2 would fix the problem and remove the log warning

Concerning the power of 2 texture, switching to proper power of 2 textures did resolve a lag issue that was previously observable in the HTML5 build. That issue was not present on other platforms though. Good to know.

I’ve also found that you can run from chrome without a server by going in window’s run command (windows key + r) and typing
chrome --allow-file-access-from-files
I was able to run my projects that way on chrome like I did on Firefox without a server. I guess it’s just another way to do it.