0

Sentry is showing that certain Facebook users are receiving the error:

FBInstant is not defined

My HTML file includes scripts like so just after the opening <body> tag:

<script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/app.js"></script>

In app.js, FBInstant.initializeAsync is only called after the entire page has loaded:

window.onload = function() {
    FBInstant.initializeAsync().then(function() {
       //Load stuff, etc.
    });
}

Is fbinstant.6.2.js not being loaded for some reason? This is working for the vast majority of people. It seems to be mostly Chrome users, with a smaller portion of Firefox users as well.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66

1 Answers1

0

You should always check if it exists before using it, i had the same problem with the JS SDK of Facebook and found out that those people just installed a browser plugin like Ghostery to disable third party plugins.

andyrandy
  • 72,880
  • 8
  • 113
  • 130