Interrupción parcialshare-external
Facebook SDK config file making call to localhost
13

Since 5th September, our internal JS error tracking has been flagging failed fetch requests to localhost:12387. No changes have been made on our side, and the existing Facebook tracking pixel we use loads via Google Tag Manager.

Specifically, on closer inspection, the config file found at - https://connect.facebook.net/signals/config/ - has this chunk of code within it that tries to make a call to localhost.

(function(a,b,c,d){var e={exports:{}};e.exports;(function(){var f=a.fbq;f.execStart=a.performance&&a.performance.now&&a.performance.now();if(!function(){var b=a.postMessage||function(){};if(!f){b({action:"FB_LOG",logType:"Facebook Pixel Error",logMessage:"Pixel code is not installed correctly on this page"},"*");"error"in console&&console.error("Facebook Pixel Error: Pixel code is not installed correctly on this page");return!1}return!0}())return;f.__fbeventsModules||(f.__fbeventsModules={},f.__fbeventsResolvedModules={},f.getFbeventsModules=function(a){f.__fbeventsResolvedModules[a]||(f.__fbeventsResolvedModules[a]=f.__fbeventsModulesa);return f.__fbeventsResolvedModules[a]},f.fbIsModuleLoaded=function(a){return!!f.__fbeventsModules[a]},f.ensureModuleRegistered=function(b,a){f.fbIsModuleLoaded(b)||(f.__fbeventsModules[b]=a)});

f.ensureModuleRegistered("SignalsFBEvents.plugins.actionid",function(){

return function(a,b,c,d){var e={exports:{}};e.exports;(function(){"use strict";var a=f.getFbeventsModules("SignalsFBEventsPlugin"),b=f.getFbeventsModules("SignalsFBEventsEvents"),c=b.setFBP,d=f.getFbeventsModules("signalsFBEventsGetIsAndroid"),g=f.getFbeventsModules("signalsFBEventsGetIsAndroidIAW");b=f.getFbeventsModules("SignalsFBEventsLogging");var h=b.logError;b=f.getFbeventsModules("SignalsFBEventsLocalStorageUtils");var i=b.getLocalStorageItem,j=b.setLocalStorageItem,k=b.isLocalStorageSupported,l=2,m=0;e.exports=new a(function(a,b){if(g()||!d()||!k())return;c.listen(function(a,c){if(a==null||c==null||c===""||m>=l)return;a=b.pluginConfig.get(a,"actionID");if(a==null)return;var d=a.portNumber;a=a.ttlInHour;var e="aidTime",f=i(e);if(f!=null&&(new Date().getTime()-Number(f))/(1e36060)<a)return;m++;fetch("http://localhost:"+d+"/?aid="+encodeURIComponent(c)).then(function(a){a.ok&&j(e,new Date().getTime())})["catch"](function(a){a.message="[ActionID Error] "+a.message,h(a)})})})})();return e.exports}(a,b,c,d)});e.exports=f.getFbeventsModules("SignalsFBEvents.plugins.actionid");f.registerPlugin&&f.registerPlugin("fbevents.plugins.actionid",e.exports);

f.ensureModuleRegistered("fbevents.plugins.actionid",function(){

return e.exports})})()})(window,document,location,history);

Can anyone advise why a request exists in this file for localhost in production?

Olly
Pregunta realizada hace aproximadamente 2 meses
Peter

I'm seeing this too, any word from Facebook about this?

22 de septiembre a las 8:33 p. m.
Nuttakit

same here

23 de septiembre a las 3:09 a. m.
Olly

No word from Facebook, raised a ticket but have just got arbitrary stuff back so far. Will update if I get to the bottom of it

24 de septiembre a las 3:19 a. m.
Daniel

I'm also see this. Thanks in advance, Olly!

26 de septiembre a la 1:07 p. m.
Nemrod

Same here...

27 de septiembre a la 1:20 p. m.
Olly

This seems to be fixed on my SDK as of 1st October between 19:00 and 20:00 BST. No acknowledgement has come from Meta at all on this though. My support request with them got a generic response and then ignored thereafter.

21 de octubre a las 3:16 a. m.
Olly

It's a shame accountability hasn't been taken, we rely on these tools to work properly and have no control over them so at the very least we should be given an explanation on what went wrong. But I assume the truth of the matter is a developer pushed their local code live and it wasn't QA'd properly.

21 de octubre a las 3:19 a. m.
Robert

Still getting this but now it's a websocket connection

https://connect.facebook.net/signals/config/330423837344621?v=2.9.173&r=stable

e.exports = new a(function(a, b) {
    if (g() || !d() || !k())
        return;
    c.listen(function(a, c) {
        if (a == null || c == null || c === "" || n >= l)
            return;
        a = b.pluginConfig.get(a, "actionID");
        if (a == null)
            return;
        var d = a.portNumber;
        a = a.ttlInHour;
        var e = i(m);
        if (e != null && (new Date().getTime() - Number(e)) / (1e3 * 60 * 60) < a)
            return;
        n++;
        try {
            var f = new WebSocket("ws://localhost:" + d);
            f.onerror = function(a) {
                h(new Error("[ActionID Error] Send WS error"))
            }
            ;
            f.addEventListener("open", function(a) {
                f.send("aid=" + encodeURIComponent(c)),
                f.readyState === WebSocket.OPEN && j(m, new Date().getTime()),
                f.close()
            })
        } catch (a) {
            a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message),
            h(a)
        }
    })
}
24 de octubre a las 7:50 a. m.
Robert

Still getting this but now it's a websocket connection

https://connect.facebook.net/signals/config/330423837344621?v=2.9.173&r=stable

e.exports = new a(function(a, b) {
    if (g() || !d() || !k())
        return;
    c.listen(function(a, c) {
        if (a == null || c == null || c === "" || n >= l)
            return;
        a = b.pluginConfig.get(a, "actionID");
        if (a == null)
            return;
        var d = a.portNumber;
        a = a.ttlInHour;
        var e = i(m);
        if (e != null && (new Date().getTime() - Number(e)) / (1e3 * 60 * 60) < a)
            return;
        n++;
        try {
            var f = new WebSocket("ws://localhost:" + d);
            f.onerror = function(a) {
                h(new Error("[ActionID Error] Send WS error"))
            }
            ;
            f.addEventListener("open", function(a) {
                f.send("aid=" + encodeURIComponent(c)),
                f.readyState === WebSocket.OPEN && j(m, new Date().getTime()),
                f.close()
            })
        } catch (a) {
            a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message),
            h(a)
        }
    })
}
24 de octubre a las 7:50 a. m.
Robert

Still getting this but now it's a websocket connection

https://connect.facebook.net/signals/config/330423837344621?v=2.9.173&r=stable

e.exports = new a(function(a, b) {
    if (g() || !d() || !k())
        return;
    c.listen(function(a, c) {
        if (a == null || c == null || c === "" || n >= l)
            return;
        a = b.pluginConfig.get(a, "actionID");
        if (a == null)
            return;
        var d = a.portNumber;
        a = a.ttlInHour;
        var e = i(m);
        if (e != null && (new Date().getTime() - Number(e)) / (1e3 * 60 * 60) < a)
            return;
        n++;
        try {
            var f = new WebSocket("ws://localhost:" + d);
            f.onerror = function(a) {
                h(new Error("[ActionID Error] Send WS error"))
            }
            ;
            f.addEventListener("open", function(a) {
                f.send("aid=" + encodeURIComponent(c)),
                f.readyState === WebSocket.OPEN && j(m, new Date().getTime()),
                f.close()
            })
        } catch (a) {
            a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message),
            h(a)
        }
    })
}
24 de octubre a las 7:50 a. m.
Robert

Still getting this but now it's a websocket connection

https://connect.facebook.net/signals/config/330423837344621?v=2.9.173&r=stable

e.exports = new a(function(a, b) { if (g() || !d() || !k()) return; c.listen(function(a, c) { if (a == null || c == null || c === "" || n >= l) return; a = b.pluginConfig.get(a, "actionID"); if (a == null) return; var d = a.portNumber; a = a.ttlInHour; var e = i(m); if (e != null && (new Date().getTime() - Number(e)) / (1e3 * 60 * 60) < a) return; n++; try { var f = new WebSocket("ws://localhost:" + d); f.onerror = function(a) { h(new Error("[ActionID Error] Send WS error")) } ; f.addEventListener("open", function(a) { f.send("aid=" + encodeURIComponent(c)), f.readyState === WebSocket.OPEN && j(m, new Date().getTime()), f.close() }) } catch (a) { a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message), h(a) } }) }

24 de octubre a las 7:50 a. m.
Robert

Still getting this but now it's a websocket connection

https://connect.facebook.net/signals/config/330423837344621?v=2.9.173&r=stable

24 de octubre a las 7:50 a. m.
Robert

``` e.exports = new a(function(a, b) { if (g() || !d() || !k()) return; c.listen(function(a, c) { if (a == null || c == null || c === "" || n >= l) return; a = b.pluginConfig.get(a, "actionID"); if (a == null) return; var d = a.portNumber; a = a.ttlInHour; var e = i(m); if (e != null && (new Date().getTime() - Number(e)) / (1e3 * 60 * 60) < a) return; n++; try { var f = new WebSocket("ws://localhost:" + d); f.onerror = function(a) { h(new Error("[ActionID Error] Send WS error")) } ; f.addEventListener("open", function(a) { f.send("aid=" + encodeURIComponent(c)), f.readyState === WebSocket.OPEN && j(m, new Date().getTime()), f.close() }) } catch (a) { a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message), h(a) } }) }

24 de octubre a las 7:52 a. m.
Robert
// e.exports = new a(function(a, b) {
//     if (g() || !d() || !k())
//         return;
//     c.listen(function(a, c) {
//         if (a == null || c == null || c === "" || n >= l)
//             return;
//         a = b.pluginConfig.get(a, "actionID");
//         if (a == null)
//             return;
//         var d = a.portNumber;
//         a = a.ttlInHour;
//         var e = i(m);
//         if (e != null && (new Date().getTime() - Number(e)) / (1e3 * 60 * 60) < a)
//             return;
//         n++;
//         try {
//             var f = new WebSocket("ws://localhost:" + d);
//             f.onerror = function(a) {
//                 h(new Error("[ActionID Error] Send WS error"))
//             }
//             ;
//             f.addEventListener("open", function(a) {
//                 f.send("aid=" + encodeURIComponent(c)),
//                 f.readyState === WebSocket.OPEN && j(m, new Date().getTime()),
//                 f.close()
//             })
//         } catch (a) {
//             a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message),
//             h(a)
//         }
//     })
// }
24 de octubre a las 7:53 a. m.
Robert
//         try {
//             var f = new WebSocket("ws://localhost:" + d);
//             f.onerror = function(a) {
//                 h(new Error("[ActionID Error] Send WS error"))
//             }
//             ;
//             f.addEventListener("open", function(a) {
//                 f.send("aid=" + encodeURIComponent(c)),
//                 f.readyState === WebSocket.OPEN && j(m, new Date().getTime()),
//                 f.close()
//             })
//         } catch (a) {
//             a instanceof Error && Object.prototype.hasOwnProperty.call(a, "message") && (a.message = "[ActionID Error] Send WS exception: " + a.message),
//             h(a)
//         }
//     })
24 de octubre a las 7:53 a. m.
Robert
//         try {
//             var f = new WebSocket("ws://localhost:" + d);
//             f.onerror = function(a) {
//                 h(new Error("[ActionID Error] Send WS error"))
//             }
24 de octubre a las 7:53 a. m.
Respuesta seleccionada
1

Another +1 here, and my client is in the EU region. I posted something similar to the forums (https://developers.facebook.com/community/threads/937149104821259/), but haven't heard anything.

30 de septiembre a las 7:36 a. m.
Dermot
1

Same here in Taipei

30 de septiembre a las 11:49 p. m.
Rory Huang
1

Hi guys, any update here? We're seeing it too. Though it seems it appears in console only sometimes, not all the time.

3 de octubre a la 1:42 a. m.
Kuba
Kuba

Update: The error in console occurs only when we click on "Toggle device toolbar"

3 de octubre a las 2:40 a. m.
1

same

4 de octubre a la 1:42 a. m.
Maytas
1

Same here

4 de octubre a las 5:53 a. m.
Nicolas
1

same here

8 de octubre a las 2:55 a. m.
Arildo
1

same here

8 de octubre a la 1:08 p. m.
Kauan
1

Same here. This is affecting the accuracy of advertisements. I can check with the relevant user agent for Androids

15 de octubre a la 1:48 a. m.
Hitoshi Kojima
1

Same here, this error looks pretty ugly. Why is Facebook trying to connect to localhost? It looks very shady

29 de octubre a la 1:33 a. m.
Daniel Wróblewski
1

Same issue here.

I spoke with Meta support on the phone and even shared a video showing the error and the exact line of code where it occurs. The pixel version affected on my site is v2.9.174. I was told they'll escalate the issue to the appropriate team.

The more attention we bring to this, the quicker it might get fixed, so I think others could report the issue too.

29 de octubre a las 8:05 p. m.
Jorge
1

Same issue here

31 de octubre a la 1:07 p. m.
Peeyoosh
1

Same problem here, ongoing since September 2024 (or earlier). Google Analytics shows: WebSocket connection to 'ws://localhost:12387/' failed: Error in connection establishment: net::ERR_NOT_IMPLEMENTED

13 de noviembre a las 5:10 a. m.
Glenn
2

same here in Seoul

24 de septiembre a las 12:11 a. m.
허성훈
3

it been couple weeks now. Any fix on this at all?

9 de octubre a las 3:49 a. m.
Nuttakit
3

When is someone going to seriously fix this, come on facebook it's not good enough!

9 de octubre a las 12:17 p. m.
Simon
4

This looks to be resolved now if you want to check.

10 de octubre a las 7:48 a. m.
Tim
Renato

for me too, thanks!

10 de octubre a las 11:06 a. m.
5

same here!

23 de septiembre a las 11:03 a. m.
Álvaro