HTML5 runtime exception on windows focus (SOLVED)

Hi guys!

I uploaded my jam game, I agree there is a lot of mess, I took a lot of code from my other projects and I don’t have now a clue on how can I debug this issue, so maybe you have some ideas why such runtime errors could appear on window focus in a HTML5 build?

HTML5 settings:

Which extensions are you using? Is there an extension that could possibly react to focus changes in native code?

DefSave, Log and Err by Pkeod, Defold-Orthographic, Monarch, DefArc, Gooey, Defold Printer, most of them are only Lua modules - maybe Defold-Orthographic?

Have you tried to upload an empty example app?
Does that work properly?
If so, then I’d start looking at removing your extensions one-by-one and see if it starts working.

1 Like

Yes, empty project do not have this problems, so I am following your advice rn :wink:

The empty project though have other problem when uploaded on itch:

But then dmloader proceeds

1 Like

There is a mention of “tryShowingMateBar”. What is that? Some itch.io thing? Something you’ve added?

Nothing that I added :confused:

In debug mode I have one more error before it:

I have a lot of shader work here, so probably there is some error - but how could I find that / operation? :smiley: But definitely there is a problem with dividing vec2 by int and it not works in HTML5 build :confused: If I will not find it anywhere in codebase - what could it be?

It was solved on Discord thanks to @Dragosha !

The problem was in fact in one of fragment programs:

vec2 Radius = vec2(blur_params.w, blur_params.w)/100;

corrected to:

vec2 Radius = vec2(blur_params.w/100.0, blur_params.w/100.0);

Though, I still don’t know, how you found the exact line :smiley: Would love to learn how to debug it in the future!

1 Like

Ah, discovered a similar issue a while back when I helped another user debug a project. I can’t remember, but I think I got an error when trying to bundle the project for Windows. The cross compiler for shaders complained about integer vs float. I wonder if we can add some flag to the compiler to generate an error for this kind of situation? @jhonny.goransson ?

In my case only problem was with HTML5 build (and in the past I also had only problems with HTML5 builds and it was almost all the time the problem with some shader)

For future reference, @Dragosha on Discord pointed out how to read those logs (which I’m ashamed, I couldn’t notice, even after reading it a hundred times…)

I was focusing to much on the message itself, while below was another warning, that because of this error, the resource couldn’t be created and that’s vital!

If you ask me, such conversion in shaders (dividing floats by ints, or vec2 by ints) could have been detected in development, if it’s vital for one of the platforms. But learned about this and advised by Igor I will be testing shaders with HTML5 builds more often.

P.S.
Other than this, there are problems with HTML5 when you use Lua multiple line comments --[[ ]] and somewhere you nest it. It is allowed in Editor, everywhere, but HTML5. But the message, than is pretty straight-forward.

1 Like

The problem is that we cannot always test what the final driver on the device is going to say about the shaders.
However, certain things can probably be highlighted better, and we are currently working on adding linter functionality to the editor. Hopefully we can add such a linter to the glsl shaders as well. We’ll see.

3 Likes