Override a single JavaScript file from a module In my theme's libraries.yml file, after the global-styling section, i'm trying to replace one JavaScript file from the core Toolbar module (it's addition of padding-top to body interferes with our theme, so just changing that to margin-top).  

libraries-override:
  toolbar/toolbar:
    js:
      js/views/BodyVisualView.js: js/views/BodyVisualView.js


I repeatedly get the error:


  Drupal\Core\Asset\Exception\IncompleteLibraryDefinitionException:
  Incomplete library definition for definition 'libraries-override' in
  extension 'mythemename' in
  Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (line 93
  of
  /vagrant/web/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php).
The answer is simply that the libraries-override definition must go in the .info.yml not .libraries.yml:

So in mythemename.info.yml:

libraries:
  - mythemename/global-styling
libraries-override:
  toolbar/toolbar:
    js:
      js/views/BodyVisualView.js: js/views/BodyVisualView.js


If placed logically there, alongside the libraries definition, it works perfectly.

Note that the second 'toolbar' is the library name from toolbar.libraries.yml, other library names in there include toolbar.menu, so if overriding a file from there it would be "toolbar/toolbar.menu:" instead of "toolbar/toolbar:".