Facebook initialize failed ReferenceError: FB is not defined (SOLVED)

Hi, all was fine in 1.2.164 version, in last 1.2.166. something going weird in html5, I see that issue:
Facebook initialize failed ReferenceError: FB is not defined

I use custom engine_template.html, but I also tried to do via default (/builtins/manifests/web/engine_template.html) - same error.

My custom engine_template

and of course in game.project I have Facebook appId.

Does anyone have same issue? Any help will be appreciated!

Can you check that the generated index.html contains the following lines:

1 Like

Thanks a lot @britzl I missed that somewhere…

What do you mean? It should automatically be included in your final index.html by the build system. Did your remove it but hand after the build?

1 Like

I mean I missed that need to add this code now since 1.2.165 or 1.2.166, because in 1.2.164 all works fine.

about automatically including, if select the following default engine_template.index :
image

there is same error in 1.2.166 version also.

I see. @JCash we should be merging these right?

1 Like

Yes, and the merged result should be found in your build folder.
Could you share it please?

do you mean the final engine_template.index?

The final engine_template.html, yes.

added (just added lines that @britzl mentioned).

but to be honest to it’s not ideal solution, because now, the loading of engine depends on availability file: //connect.facebook.net/en_US/sdk.js

True. This could be changed, but you must then check availability of Facebook in your code before using it.

2 Likes

created simple example, just empty project with fb-extension:

with standart template (/builtins/manifests/web/engine_template.html)
result of 1.2.164:
image

result of 1.2.166:
image

2 Likes

Yep, we know. I’m investigating it. We changed how we are merging manifests. It used to happen in bob, but now it happens on the build server. And apparently something goes wrong when it happens on the server.

1 Like

This has been resolved now in the latest version.

1 Like

just checked, works fine in 1.2.167!

2 Likes