About problems with HTML5 builds

I’m doing a game for a jam (closing in few days) - I can use the game running from defold, even built as win64 exe - but something’s wrong with html5 build (your remote building system - on game page - says there’s an undefined problem - and if I upload the zip online - or if I try to use that version online on another site) I see your logo then the game “stops” (black screen and nothing more)
How can I understand what’s wrong in my game?
Times ago a similar problem was due to duplicated name in resources - but that I could get as an error message with local build - while now I get none.
I mean I don’t want you to found and fix problems for me - but, well, if you’re own building system is able to detect a “problem” I would like to have an hint about it - if possible
Thanks in advance :slight_smile:

3 Likes

Open Chrome developer tools and look in the console (Ctrl-Shift-J). Can you copy paste the error messages here?

This is what I see on my website - after uploading

Failed to load resource: the server responded with a status of 404 (Not Found)
dmloader.js:349 Running…
*dmloader.js:349 *
2StoryMode_asmjs.js:1 WebGL: INVALID_ENUM: getParameter: invalid parameter name
emscriptenWebGLGet @ StoryMode_asmjs.js:1
StoryMode_asmjs.js:1 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
_dmDeviceJSOpen @ StoryMode_asmjs.js:1

This is instead the messages list I see for the same game on you dashboard page (I build from defold and uploaded)

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”).

b4d950b67624234ea3cd0f568ebb020a0f9c5b1f

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”).

241afcaaa872ed041c465eefec953a7bc8158357

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”).

bbe74d915a65e89630f1d1f71d03a6e41038ee26

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”).

1da91fb0f1957622d0050edf2e29ecaa107324ce

The script from “https://magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/dmloader.js” was loaded even though its MIME type (“application/octet-stream”) is not a valid JavaScript MIME type.

index.html

The script from “https://magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/StoryMode_wasm.js” was loaded even though its MIME type (“application/octet-stream”) is not a valid JavaScript MIME type.

index.html

Error: WebGL warning: getParameter: pname: invalid enum value MAX_ELEMENTS_VERTICES StoryMode_wasm.js:1:195155

Error: WebGL warning: getParameter: pname: invalid enum value MAX_ELEMENTS_INDICES

Thanks for your support

A note - I still don’t have audio resources in game - I write it because there’s a reference to sound in the first log
A second note - a previous build (4/5 days ago) worked

There’s a texture size limit - different from desktop? I may have one 2048x1024 texture (and some others smaller - less than 10/15 at most anyway)

Are you sure you’re on the latest Chrome? Update it. And update your GPU drivers too, just in case they don’t play nice with your version of Chrome. From the errors, it looks like your version might not be supporting WebGL 2.

Though this is weird.

1 Like

Thanks - but I’ve tried with other browsers too - FireFox, Edge and Brave - on two different machines

I’ve the game playable from here http://marcogiorgini.com/public/StoryMode/ - could you try it - just to be sure it’s not my computers fault?

I doesn’t work even of my mobile phone (safari)

It seems like a problem somewhere in logic. Because I have the same log messages in html5 build as you have but my game works.
What libraries are you using in the game? Do you have some native code?

1 Like

only defos

a question - run html5 version in defold - and build html5 package do the same work? if so that way I could try removing thing and try until I found the issue (as long as you say that errors logged are not a real problems)

If you choose “Build HTML5” from the menu, it will build a custom engine for you (if you have native extensions or an app manifest).

2 Likes

Could you please try uploading a debug version of the HTML5 game, perhaps there are some log errors that isn’t visible in the release version.

2 Likes

ok. I can do that but just tonight, when I’m back home. Thanks

2 Likes

Ok - I think I got it. At start I check if the engine is in debug (sys.get_engine_info().is_debug to choose which internal config I want to use) - that line it seems to crash - in html5 (not in win, not inside defold)
now I check if I got sys.get_engine_info() before addressing is_debug - and this way it works
Has this any sense?
Anyway now it works even your remote build (!( - not sure how can it be aware of the issue and stopping compilation (while it works in defold) but at the moment evetything works again

Thanks for your support

So you’re saying that sys.get_engine_info() returned nil?

that is what I suspect (in html5) because with this change

local config
local info=sys.get_engine_info()

if info and info.is_debug then
	config=M.game["debugconfig"]
else
	config=M.game["config"]		
end

before was if sys.get_engine_info().is_debug then

the html5 started to work

tomorrow I’m going to verify that better

if you don’t think that’s possible I’ll check it further - I need the html5 working and jam deadline for me is friday night

Update: I’ve still have (again) problem - but just on the community page - the following lines are log info there.
I’ve been able to play with html5 version on my site (same browser, same internet line - just different site) - so I keep my finger crossed - maybe this issue is not a real problem

dmloader.js:579 FS syncfs error: UnknownError: The user denied permission to access the database.
(anonymous) @ dmloader.js:579
dmloader.js:347 wasm streaming compile failed: TypeError: Failed to execute ‘compile’ on ‘WebAssembly’: Incorrect response MIME type. Expected ‘application/wasm’.
printErr @ dmloader.js:347
dmloader.js:347 falling back to ArrayBuffer instantiation
printErr @ dmloader.js:347
dmloader.js:349 Running…
dmloader.js:349
dmloader.js:346 INFO:ENGINE: Defold Engine 1.2.155 (838cecd)
dmloader.js:347 exception thrown: TypeError: Cannot read property ‘length’ of null,TypeError: Cannot read property ‘length’ of null
at _glGetString (https://magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/StoryMode_wasm.js:1:257566)
at wasm-function[1468]:561
at wasm-function[512]:1698
at wasm-function[520]:77
at wasm-function[519]:35
at wasm-function[507]:85
at wasm-function[445]:5
at Object._main (https://magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/StoryMode_wasm.js:1:341410)
at Object.callMain (https://magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/StoryMode_wasm.js:1:351941)
at Object._preloadAndCallMain (https://magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/dmloader.js:674:24)
printErr @ dmloader.js:347
dmloader.js:346 INFO:CRASH: Successfully wrote Crashdump to file: /data/.Defold/_crash
dmloader.js:349 Exception thrown, see JavaScript console
StoryMode_wasm.js:1 Uncaught TypeError: Cannot read property ‘length’ of null
at _glGetString (StoryMode_wasm.js:1)
at magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/wasm-function[1468]:561
at magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/wasm-function[512]:1698
at magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/wasm-function[520]:77
at magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/wasm-function[519]:35
at magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/wasm-function[507]:85
at magazine.defold.org/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIiLCJ3IjpmYWxzZSwiZXhwIjoxNTYyMTEyMDAwLCJ1cmkiOiIvcHJvamVjdHMvMTQ0NDg0L3BsYXlhYmxlIn0.xAQ8f5Xxo3aIobJxJi323HndYCplEFXbfSwpMaUR-RmtuHTENpYPZSeXYohwQeQglj5VMOoxk3xn_EU9KgYOvA/wasm-function[445]:5
at Object._main (StoryMode_wasm.js:1)
at Object.callMain (StoryMode_wasm.js:1)
at Object._preloadAndCallMain (dmloader.js:674)

I’m sorry to hear that you’re having problems with html5 builds. Let me know if you’re able to confirm a problem that is reproducible somehow. I’ll happily also take a look at your project should you wish to share it.

1 Like

thanks - really appreciated. Anyway I’ve done some test and on my site and (more important) on gamejolt the html5 version seems to work now (if I check to not use https ) - so the “problem” seems to be related to the remote building system and/or defold communitypage
If you don’t mind I’ll gladly send you privately a package with the whole project, if you can see what wrong with your remote building system - that I actually love because it’s faster for sharing things with some beta tester
but beign working on jam page I’m less in a hurry - thanks

1 Like