Home Forums General Issues Twitter oembed is text only? Reply To: Twitter oembed is text only?

  • So the issue was that this was being displayed in a vue app which, for some reason, caused the twitter widgets.js rendering to fail probably due to timing of sorts.

    I solved this by loading the script in my template according to and triggering the widget load on $nextTick in the callback.

    window.twttr = (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0],
        t = window.twttr || {};
      if (d.getElementById(id)) return t;
      js = d.createElement(s); = id;
      js.src = "";
      fjs.parentNode.insertBefore(js, fjs);
      t._e = [];
      t.ready = function(f) {
        this.nextTick(() => twttr.widgets.load())   
      return t;
    }(document, "script", "twitter-wjs"));