Regression bug of requests with wrong url sent from widgets.js


In these days, the twitter widget often doesn’t work because of requesting a wrong url like this:

Looks like this is a regression bug of My User timeline Twitter widget is causing a "null" page request.

The bug appears when a request is instantly made after the widget is loaded. So if we put a delay about 1 second after there, requests sent from widget works fine. However, this workaround is invalid for tweets embedded before loading the widget because the widget wrongly processes them instantly.


Hi @falsandtru,

Can you please provide more info about this issue? The url to the page where this is happening, the embed code you’re using, and the os & browser/version you’re using would be really helpful to debug this further.



Please try the following steps:

  1. Clone and checkout v0.85.2.
  2. Run npm i && bundle install && npm -g i gulp.
  3. Run gulp view.
  4. Open the displayed url like with secret or guest window of Chrome.
  5. You’ll see a failure of tweet rendering and a wrong request.
  6. If not, reload the window. It will appear several times in 10.

This problem appears on all websites with the low probability but looks like it appears with the high probability when a browser has many extensions.


@evansobkowicz Can you see the repro?


Hi @falsandtru,

Can you please provide a live URL that I can look at without pulling your code?



I couldn’t provide an example but I found the cause of the problem!

null comes from the following code by the timeout processing because the timeout value is only 400ms! It is too short!! Please give the long value enough (Probably it should be over 3 seconds).

        function o(e) {
            w.timeout(u(p.tweetBatch()), T).catch(function() {
                return g.devError("Settings promise failed to resolve in batch_fetch_html"),
            }).then(function(t) {
                c(t, e)
        function c(e, t) {
            var n = m(t, r);
            C.forIn(n, function(t, n) {
                var r = t.split(k)
                  , o = r[0]
                  , c = r[1]
                  , d = i(o, c, n)
                  , u = f(a, null, n)
                  , l = f(s, null, n);
                b.fetch(e, d, h).then(u, l)
        function d() {
            this.requestQueue = new l(o)
        var u = n(227)
          , l = n(40)
          , h = n(228)
          , f = n(15)
          , p = n(78)
          , m = n(44)
          , b = n(136)
          , v = n(138)
          , g = n(10)
          , w = n(34)
          , C = n(12)
          , E = "en"
          , x = "light"
          , k = ","
          , T = 400;



We experience exactly the same issue on our mobile web site And App, when opening an article with android device.

it’s requesting a wrong URL like the following:

is there a solution for that?




Note that even when we set a long value to the timeout, that request sometimes has failed by some ad-blockers like Ghostery. But if we stop it, twitter widget works fine. Thus changing the timeout value is the perfect solution.


Hi @evansobkowicz ,

We seem to be having a similar issue when loading tweets in our section pages on Safari for mac, iOS as well as android devices. Bug reports for this issue spiked sometime later last week without any recent code changes on our end.

We have noticed tweets fail to load via twttr.widgets.load(elem) when the iframe widget takes a bit longer to process (I haven’t debugged further).

Here is an example:

Public page:

Steps to repro:
Load the page a few times on safari for mac while toggling caching on and off (in dev network tab) a few times.
When tweets fail to render correctly notice the call to /null and the slower processing time for the widget iframe

We are not entirely sure the issue is not on our end at this point but since this looked like a similar bug that was already filed we decided to join the conversation.

We appreciate any feedback.



Thanks for all the reports! We’re looking into this.


@falsandtru @pcanterini @haaretzcom

Thank you all for the reports on this. We’ve found the cause of the null url and resolved the issue. Please let us know if you’re still seeing this issue (after clearing your widgets.js cache).



Strange but solved.

        function o(e) {
            w.timeout(u(p.tweetBatch()), T).catch(function() {
                return g.devError("Settings promise failed to resolve in batch_fetch_html"),
            }).then(function(t) {
                c(t, e)


Verified on my end as well, it doesn’t seem to be happening anymore (
Thanks for looking into this so promptly.



This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.