keppelen / react-facebook-login

A Component React for Facebook Login

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isSdkLoaded always `false` when deployed to production

MarkLyck opened this issue · comments

When deployed to my production environment the isSdkLoaded stays false forever despite react-facebook-login making a successful call to the sdk, and window.FB being set correctly.

This only seems to happen when deployed to https. It works fine in localhost.

When deployed, I'm getting the following renderProps:

{
    "isDisabled": false,
    "isProcessing": false,
    "isSdkLoaded": false
}

and nothing happens when I run the renderProps.onClick function.

The module is loaded and it succesfully makes 1 request to the facebook sdk endpoint.
Screen Shot 2022-07-06 at 17 35 43

I also see it created this div in my HTML:

<div id="fb-root"></div>

and if I console.log window.FB it logs it fine as a function:

ƒ FB(e,t){var n;return!kB(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(n=new TB("chunk",["string","Buffer","Uint8Array"],t)),n}

But no matter what this library will not go past the isSdkLoaded when deployed to a production environment?

I have tried both with and without a valid SSL certificate, and it is on HTTPS so it should not be a security issue.

No errors are being logged, and the onFailure callback is never called :(

neither is the normal callback function.

VERSION: "react-facebook-login": "4.1.1",