I uploaded a HTML5 build to the Facebook app. I am creating an Instant game. However after trying it in the browser (using the fb link), I get an error that runtime is not defined:
I followed the FB Instant tutorial. What other information can I provide you so you could help me? This is by the way the second version. I was able to upload the first version a week ago or so.
If I disable FB Instant related code and try Project > Build HTML5 then it works. No issues.
If I use FB instant related code and use Project > Build HTML5 then I get this result:
And finally, when I Bundle HTML5 and run a local http-server then this is the result (WITH Facebook enabled code. Bundling HTML5 without FB code runs the game nicely in browser and has the same output in both the bash window and the Edge browser’s console with the exception of not having the line “FBInstant inited undefined”):
This is expected. The extension only works on HTML5.
Ok, good to know.
Ah, now I see what’s wrong. We updated Emscripten a while back and the Runtime object has been removed (which was mentioned in the browser console error you shared in your first post). I guess no one has built a new version of an instant game since then. I’ll update extension-fbinstant!
I went through their “Testing the game from a local server” section. At the end of “Enabling SSL via localhost” it says that I should be able to test the game by going to https://127.0.0.1:8080. But really it is giving the same errors and I just see the Defold logo, which immediately turns into a black screen:
Then I went further and tried to follow the “Running the embedded player from your browser”. But loading is stuck at 0% and I have an error:
After disabling the antivirus and restarting the server and refreshing the page it is still stuck at 0% (saying also how many of my friends play). But the console is empty.
Apparently it seems I have to restart the browser after pausing Kaspersky. It is not enough to just refresh the page. So: 1. close browser; 2. disable antivirus;3. open browser.
I also tried activating/deactivating VPN but that did not seem to have any effect. Someone in the future facing same issues, just pause protection and maybe even VPN and restart the browser (not just refresh).
Also, if the browser’s anti virus extension or some other security measure asks you to allow untrusted certificates, you must allow them, to host a server on your own machine.