Adding (external) javascript to a theme I'm trying to add external JavaScript to my Drupal 8 theme. Can someone tell me what I'm doing wrong here? This function is in my MYTHEME.theme file: 

      function MYTHEME_preprocess_page(&amp;$variables) {
      $vars['ext_js'] = array(
        '#attached' =&gt; array(
          'data' =&gt; 'http://cdn.somelibrary.com/library/2.3.1/js/jslibrary.min.js', 
          'options' =&gt; array(
            'preprocess' =&gt; TRUE,
            'every_page' =&gt; TRUE, 
            'group' =&gt; 'NONE',
            ),
        ),
      );
}


Then in the theme I'm rendering it with: 

{{ ext_js }}
Try adding 'type' =&gt; 'external', to the options array index.
By default, the type is considered to be a reference to a file hosted on your Drupal site; by using 'type' =&gt; 'external', you are specifying that data is a reference to a file hosted on a different host.