Embedded tweet produces the following error in Chrome:

Uncaught TypeError: Cannot read property 'twttr.button' of null
    at o (widgets.js:10)
    at s._onMessage (widgets.js:10)
    at widgets.js:8

Here’s the code for the embedded tweet:

<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">zoom into the dog nose <a href="https://t.co/DjHG0QhGw9">pic.twitter.com/DjHG0QhGw9</a></p>&mdash; 🍃🏅SNCKPCK ★彡 (@SNCKPCK) <a href="https://twitter.com/SNCKPCK/status/835606354387685376?ref_src=twsrc%5Etfw">February 25, 2017</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
1 Like

I’m seeing the same issue, and it even interfered with Google reCAPTCHA somehow…

1 Like

I observed the same issue - related to:

  • “react”: “0.13.3”
  • “react-google-recaptcha”: “0.4.1”

me too, just added recaptcha v2 to the page.

Still having same error.

Here is a fiddle that represents the issue:
https://jsfiddle.net/t9huow8g/1/

Seeing the same error on Chrome. Firefox has a slightly different backtrace:

TypeError: t is null   widgets.js:10:13738 
o             https://platform.twitter.com/widgets.js:10:13738
_onMessage    https://platform.twitter.com/widgets.js:10:14363
t.exports/<   https://platform.twitter.com/widgets.js:8:10154

+1 here.

Occurs when using Google reCaptcha V2 and Twitter’s widgets.js on the same page.
It’s not necessary to render widgets, just the script load is enough.

Looks like recaptcha__en.js and widgets.js both generate a message event. You can duplicate the problem with window.dispatchEvent(new Event('message'));

Hello,

I’ve the same problem (local fr). Has someone find a way to solve this problem ?

I have the same issue when page is loaded with recaptcha.

widgets.js:10 Uncaught TypeError: Cannot read property ‘twttr.button’ of null
at o (widgets.js:10)
at s._onMessage (widgets.js:10)
at widgets.js:8

Unfortunately until this issue is resolved I will have to remove twitter from the site because recaptcha is more important.

Thanks all for reporting the issue. It has been resolved in the latest version of widgets.js library. If the problem persists, let us know!

Thanks! How can we protect ourselves from similar things happening in future? Please could you make a versioned reference to the script available on your domain?

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