# HTML5 Doesen't build

**URL:** <https://forum.defold.com/t/html5-doesent-build/78251>\
**Category:** Bugs\
**Created:** [September 24, 2024, 10:20pm UTC](https://forum.defold.com/t/html5-doesent-build/78251 "2024-09-24T22:20:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrbandian](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mrbandian/32/37473_2.png) [@mrbandian](https://forum.defold.com/u/mrbandian)\
**Post date:** [September 24, 2024, 10:20pm UTC](https://forum.defold.com/t/html5-doesent-build/78251/1 "2024-09-24T22:20:27Z")

</div>

Hi there! Thank you in advance for helping me.  
I created my first folded game by downloading and modifying a free existing game. But…  
thought the build works on macOS and on “debug” it doesn’t work under HTML5  
It’s just freeze on the splash screen, but no sound, no movement if i use command keys (Everything works perfect on other no-html5 bulds).

If i Open console i see these messages.

 ![Screenshot 2024-09-25 alle 00.19.34](https://forum-defold.b-cdn.net/uploads/default/original/3X/4/4/44d907ad038c7672cce6cfe754fe538ed7418825.png)

Can someone help me?  
I really don’t know what is happening here.  
Thank you,  
bandian

---

<div class="post-metadata">

**Author:** ![Potota](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/potota/32/33404_2.png) [@Potota](https://forum.defold.com/u/Potota)\
**Post date:** [September 24, 2024, 10:40pm UTC](https://forum.defold.com/t/html5-doesent-build/78251/2 "2024-09-24T22:40:28Z")

</div>

> ⚠ Failed to execute ‘requestFullscreen’ on ‘Element’: API can only be initiated by a user gesture.

  

I can’t say for sure without seeing any code, but it sounds like a script in your game is trying to force the game into fullscreen with `defos.set_fullscreen()` or `defos.toggle_fullscreen()`. As it says in the DefOS readme:

> On HTML5, this only works from `defos.on_click()` or `defos.on_interaction()`.

---

<div class="post-metadata">

**Author:** ![mrbandian](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mrbandian/32/37473_2.png) [@mrbandian](https://forum.defold.com/u/mrbandian)\
**Post date:** [September 24, 2024, 10:52pm UTC](https://forum.defold.com/t/html5-doesent-build/78251/3 "2024-09-24T22:52:51Z")

</div>

Mmmm, actually not. Btw  
i downloaded the game from here

> **[GitHub - benjames-171/defold-games: Collection of 2D games made with Defold](https://github.com/benjames-171/defold-games)**
>
> Collection of 2D games made with Defold

and the game is TimeLooper (if you’d like to check the code).  
Even if i didn’t modify any code, i have this html5 issue.  
Thank you so much,

Francesco

---

<div class="post-metadata">

**Author:** ![Potota](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/potota/32/33404_2.png) [@Potota](https://forum.defold.com/u/Potota)\
**Post date:** [September 24, 2024, 11:09pm UTC](https://forum.defold.com/t/html5-doesent-build/78251/4 "2024-09-24T23:09:43Z")

</div>

I was sort of right, the game calls `data.fullscreen(self)` which in turn calls `defos.toggle_fullscreen()`, and that throws a warning in the console. But the game also has a domain lock built-in that disables input if the game is run in a browser, unless it’s on one of the websites listed [here](https://github.com/benjames-171/defold-games/blob/119846240267db22d855f0ee52b1cd8034b301df/Timelooper/main/handler.script#L7). Everything should work if you change:

```lua
if domaincheck() then msg.post(".", "acquire_input_focus") end

```

to:

```lua
msg.post(".", "acquire_input_focus")

```

in `handler.script`.

---

<div class="post-metadata">

**Author:** ![mrbandian](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mrbandian/32/37473_2.png) [@mrbandian](https://forum.defold.com/u/mrbandian)\
**Post date:** [September 25, 2024, 1:24pm UTC](https://forum.defold.com/t/html5-doesent-build/78251/5 "2024-09-25T13:24:52Z")

</div>

Thank you so much!  
You have been so much helpful!  
I really appreciate this.

bandian
