phanan / vue-facebook-signin-button

A simple plugin to include a custom Facebook sign-in button into your web app.
137 stars 30 forks source link

Cannot read property 'init' of undefined at window.fbAsyncInit #9

Open onkarvhanumante opened 6 years ago

onkarvhanumante commented 6 years ago

was including in created hook for asynchronous flow

when included error occurs Cannot read property 'init' of undefined at window.fbAsyncInit

window.fbAsyncInit = function() { FB.init({ appId : '{your-app-id}', cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse social plugins on this page version : 'v2.8' // use graph api version 2.8 }); }; (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'));