未捕获的错误:发生了缩小的异常[Facebook登录]

时间:2018-06-16 18:38:22

标签: facebook facebook-javascript-sdk

我正在尝试将我的网站与facebook登录集成。我已经按照Facebook(快速入门)提供的所有文档进行了操作。这是我的代码

function init() {   
    function checkLoginState() {
      FB.getLoginStatus(function(response) {
          if(response.status=="connected"){
            var fbUser = response.authResponse.userID;
            var fbAccess = response.authResponse.accessToken;
            var data = new FormData();
            data.append('fbUser',fbUser);
            data.append('fbAccess',fbAccess);
            callAjax('dologinfacebook',data);
          }
      });
    }
    checkLoginState();
}

window.fbAsyncInit = function() {
  FB.init({
    appId      : 'myappid',
    xfbml      : true,
    version    : 'v3.0'
  });

  init();
};

(function(d, s, id){
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

它运行良好,我收到的响应没有任何问题,但在我的控制台结束时。我收到以下错误。

B5sq21HbPZ9.js:44 Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.
    at a (B5sq21HbPZ9.js:44)
    at a (B5sq21HbPZ9.js:121)
    at x (B5sq21HbPZ9.js:193)
    at Object.b.post [as log] (B5sq21HbPZ9.js:193)
    at a.logVital (B5sq21HbPZ9.js:219)
    at B5sq21HbPZ9.js:293
    at Array.forEach (<anonymous>)
    at IntersectionObserver.f.threshold (B5sq21HbPZ9.js:293)

任何人都可以建议我如何删除以下错误?谢谢。

2 个答案:

答案 0 :(得分:5)

这是一个众所周知的错误:https://developers.facebook.com/support/bugs/1337180213092053/

如果您想知道它何时解决,请订阅它。

答案 1 :(得分:0)

如果您可以使用单独的链接/按钮注销,则有一个临时解决方案。 您可以使用facebook api从该单独的按钮注销:-

FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
      // Logged into your app and Facebook.

      FB.logout(function(response) {
   //Person is now logged out    
});   
    } 
    });

您可以从Facebook登录按钮关闭自动注销链接,例如data-auto-logout-link =“ false”:-

<div class="fb-login-button" data-width="10" data-max-rows="1" data-size="large" data-scope="email,public_profile" data-button-type="continue_with" data-show-faces="false" data-auto-logout-link="true" data-use-continue-as="true" >


<div class="fb-login-button" data-width="10" data-max-rows="1" data-size="large" data-scope="email,public_profile" data-button-type="continue_with" data-show-faces="false" data-auto-logout-link="false" data-use-continue-as="true" >