So, my theme.libraries.yml file shows:
global-styling:
css:
theme:
css/style.css: {}
css/custom.css: {}
js:
js/myjavascript.js: {}
In mytheme.theme, hook_preprocess_node() I have added:
$variables['#attached']['library'][] = 'myjavascript.js';
Drupal is throwing this error message:
User warning: The following theme is missing from the file system: myjavascript.js in drupal_get_filename() (line 250 of core/includes/bootstrap.inc).
I cannot see where I'm going wrong. The javascript is definitely being injected, since it all works. Why am I getting this error?
thanks