These issues are a result of Facebook crawlers executing JavaScript code.
I have encountered this problem with the following IPs (all within Facebook's IP ranges) and user agents:
66.220.149.14 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
31.13.115.2 - Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
173.252.87.1 - Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
69.171.251.11 - facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
For an updated list of Facebook crawler IPs, refer to this command from https://developers.facebook.com/docs/sharing/webmasters/crawler/:
whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
You should modify your error reporting system to exclude errors from these IP ranges.
This can be done on the client side in JavaScript by detecting the user's IP address during an error (see How to get client's IP address using JavaScript?).
Alternatively, you can handle this on the server side. Here is an example for ASP.NET MVC:
using System.Linq;
// Requires the IPAddressRange NuGet library:
// https://www.nuget.org/packages/IPAddressRange/
using NetTools;
public class FacebookClientDetector
{
/// <summary>
/// The range of CIDR addresses used by Facebook's crawlers.
/// To generate, run
/// whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
/// https://developers.facebook.com/docs/sharing/webmasters/crawler/
/// </summary>
static readonly string[] facebookIpRanges = new string[] {
"204.15.20.0/22",
"69.63.176.0/20",
...
// Remaining IP ranges omitted for brevity
};
public static bool IsFacebookClient(string ip)
{
IPAddressRange parsedIp;
if (!IPAddressRange.TryParse(ip, out parsedIp)) {
return false;
}
return facebookIpRanges.Any(cidr => IPAddressRange.Parse(cidr).Contains(parsedIp));
}
}