[FB Instant] Error when uploaded build

Hello,

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.

Thanks!

If you ignore the Facebook Instant stuff for a while and test your game without it does amy html5 build start without errors?

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:

The code that starts the Facebook stuff and which is also the entry point to the application (loading the menu collection) looks like this:

In the editor when I simply use Ctrl+B, these are the logs (notice that it always says that “Extension fbinstant is not supported”):

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”):

The Facebook app id is setup. The HTML5 settings I have are these:

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!

@Wattosan could you please try https://github.com/defold/extension-fbinstant/archive/master.zip and let me know if it works now?

1 Like

Same issue after bundling HTML5

That is a different error though. Is this when uploaded to Facebook?

No, this is when running a local http server.

Ooooh! It works when I upload it to Facebook!

The errors and warnings are still in the console though:

The warnings and errors will not impact your game. We are aware of them.

1 Like

Alright, good.

What can I help you with to figure out how to test it without uploading to Facebook?

You’re not really able to test Facebook Instant Games without actually running them from Facebook servers. You can also test using a local server as explained here: Test, Publish, Share - Facebook Games - Documentation - Meta for Developers

Interesting.

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:
image

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.

Perhaps ask in the Facebook Instant Games support channel on the Facebook Developer site. This problem is most likely not related to Defold.

1 Like

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.

1 Like