Facebook登录按钮导致"未捕获错误

时间:2018-06-13 18:55:44

标签: javascript facebook-javascript-sdk facebook-login

我在我的网络应用程序中实现了Facebook登录按钮,如下所示:

js.js:

// Facebook Login
try {
    window.fbAsyncInit = function () {
        FB.init({
            appId: 'myappidhere',
            xfbml: true,
            cookie: true,
            version: 'v2.10'
        });
        FB.AppEvents.logPageView();
    };
} catch (e) {
    throw(e)
}

(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/nb_NO/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

的index.php:

echo "    <fb:login-button scope='public_profile,email' onlogin='FacebookLogin();' size='large'></fb:login-button>";

最近我在加载页面时遇到了这个错误:我已经搜索过此错误,但只发现它与React.js有关。如果此处涉及React,则我不会加载。因此,我不认为我可以使用它所指的非缩小环境?

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

我错过了什么?

1 个答案:

答案 0 :(得分:3)

问题不是来自你,请参阅https://developers.facebook.com/bugs/780374708825818/ 每个使用facebook连接按钮的人都会遇到这个问题(请参阅pinterest登录页面,例如具有完全相同的错误)

相关问题