Search code examples
javascriptfacebookfacebook-javascript-sdkmicrosoft-edgetrackjs

Facebook connect javascript SDK issue in Edge since 28th August 2019


We noticed facebook connect issue only for Edge browser:

Failed to construct 'Request': Invalid argument.

Stack trace:

TypeError: Failed to construct 'Request': Invalid argument. at Anonymous function (https://d2zah9y47r7bi2.cloudfront.net/releases/current/tracker.js:21:358) at h (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:108:10805) at c (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:108:11202) at z (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:108:5265) at d (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:108:12427) at Anonymous function (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:151:1716) at Anonymous function (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:95:924) at Array.prototype.forEach (native code) at c (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:45:1595) at a.fire (https://connect.facebook.net/en_US/sdk.js?hash=0f8f5b593a5516f4964c585f61d84200&ua=modern_es6:95:891) enter image description here

Affected browsers:

Edge 18.18362 Edge 17.17134 Edge 18.17763 Edge 16.16299 Edge 15.15063

Is it internal issue in SDK or issue on our side?


Solution

  • The root cause of this error is a bug in all known versions of Microsoft Edge. Specifically, when creating a Request object for use in fetch, if the key referrerPolicy is provided as an init option, Edge will throw this error.

    referrerPolicy was added to the spec about a year ago (June 2018), so it's understandable that it has not been added yet. However, they should not throw an error for an unsupported option.

    The Facebook SDK is using this option in their latest version of code, which seems to have been released on or around August 27, 2019. We've seen a significant increase in this error across hundreds of internet sites since then.

    I have opened bugs with both Microsoft and Facebook.

    This error impact summary was sourced from TrackJS JavaScript Error Monitoring data.

    Update:

    We wrote a full summary of the Edge bug and Facebook impact here.