greatSumini / react-facebook-login

Well-Typed React Component for Facebook Login
https://www.npmjs.com/package/@greatsumini/react-facebook-login
MIT License
104 stars 28 forks source link

facebookNotLoaded error on button click #272

Open scottydelta opened 2 years ago

scottydelta commented 2 years ago

I am getting the error facebookNotLoaded. Do I need to load some sdk for this to work?

this is what I have:

import React from "react";
import FacebookLogin from "@greatsumini/react-facebook-login";

const responseFacebook = (response) => {
  console.log(response);
};

export default function FacebookLoginComp({ data, title }) {
  return (
    <FacebookLogin
      appId="{APP_ID}"
      initParams={{
        version: "v14.0",
        xfbml: true,
      }}
      scope="public_profile,instagram_basic,instagram_manage_insights,pages_read_engagement,pages_show_list"
      onFail={(e) => console.log("error", e)}
      onSuccess={responseFacebook}
      onProfileSuccess={responseFacebook}
    />
  );
}
greatSumini commented 2 years ago

@scottydelta Could you provide a minimal repository which reproduces this issue? 🙏🏻

Volizik commented 1 year ago

Turn on VPN helped me. Check network tab in devtools or try open https://connect.facebook.net/en_US/sdk.js

GeorgiKeranov commented 1 year ago

I had the same error and it was caused because there was an ad blocker in the browser which was blocking this file from loading https://connect.facebook.net/en_US/sdk.js and then the button was returning facebookNotLoaded, hope this helps!