Include with script tag




when I include widget.js in a script tag like that :
<script type='text/javascript' src='//'></script>

I test it in a simple html page :
<html> <head> <title>Twitter test</title> <script type='text/javascript' src='//'></script> </head> <body> test </body> </html>

I have the following error :
widgets.js:10 Uncaught TypeError: Cannot read property ‘createShadowRoot’ of null

It worked one or two weeks ago and now there is this error. Any idea ?

Thank you



Could you please provide a link to the ‘test’ page, as no code is visible in your post.



thank you for your reply, I have fixed my previous post. (My html test page is not online)


What browser are you using?

We recently switched to using Shadow DOM for rendering embedded Tweets.


If it’s of any use, Andy, I’ve just replicated the problem too using Google Chrome (Version 51.0.2704.36 beta-m).


On mac :

  • With Chrome 50.0.2661.94, i have this error :
    widgets.js:10 Uncaught TypeError: Cannot read property ‘createShadowRoot’ of null
  • With Firefox 46, this one :
    TypeError: o.body is null
  • With Safari 9.1 :
    TypeError: null is not an object (evaluating ‘o.body.createShadowRoot’)


The same problem. Version 50.0.2661.94 m

It happens on some websites. Not all of them.


I’m seeing this on my site as well.

Chrome 50.0.2661.94


In Chrome Canary : Version 52.0.2730.0 canary
widgets.js:9 Refused to apply inline style because it violates the following Content Security Policy directive: “style-src https:”. Either the ‘unsafe-inline’ keyword, a hash (‘sha256-taZolPWII8ML6ATacXLbECNoYsc2N7hLDB526X3Yslw=’), or a nonce (‘nonce-…’) is required to enable inline execution.
i @ widgets.js:9


Also the effect in FF and Chrome is an Unstyled Tweet Button


Thanks for all the information here - the web team will take a look when they can.

closed #12

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