Adding JS to field widget being created in my module Cross-posting to stackoverflow.com

I am creating a custom field to eventually be displayed in a custom paragraph.  I need to upload a JS file for the widget view, but can't seem to get it to work.  Can anyone see what I am doing wrong or need to do differently?

I can add the field to the paragraph, add the paragraph to a document and see the fields, but I see no evidence of the JS being attached (the file is not downloaded in the browser and does not activate).

Any help or suggestions are appreciated.

file: src/Plugin/Field/FieldWidget/get_libguides_listings_widget.php:

&lt;?php

namespace Drupal\get_libguides_listings\Plugin\Field\FieldWidget;

use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;

class get_libguides_listings_widget extends WidgetBase {


  /**
   * {@inheritdoc}
   */
  public function formElement(
               FieldItemListInterface $items,
               $delta, array $element, array &amp;$form,
               FormStateInterface $form_state) {
    $element['Subject_IDs'] = [
      '#type'=&gt;'textfield',
      '#title'=&gt;$this-&gt;t('Subject IDs to Display'),
      '#description'=&gt;$this-&gt;t('BLAH'),
      '#default_value'
           =&gt;isset($items-&gt;getValue()[$delta]['Subject_IDs'])
          ?$items-&gt;getValue()[$delta]['Subject_IDs']
          :'',
      '#states'=&gt;[
        'visible' =&gt; [
          [':input[name$="default_value_input[field_libguides_listing][0][SearchBy]"]'
                =&gt;['value'=&gt;'subject']],
          'or',
          [':input[name$="default_value_input[field_libguides_listing][0][SearchBy]"]'
                =&gt;['value'=&gt;'both']],
        ],
      ],
    ];
    $element['Subject_IDs']['#attached'][] 
          = 'get_libguides_listings/get_searchby';
    return $element;
  }
}


file: get_libguides_listings.libraries.yml:

get_searchby:
  js:
    js/get_searchby.js: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/drupalSettings


file: js/get_searchby.js

/**
 * @file
 */
(function(){
  alert('hello there');

  (function ($, Drupal)
  {
    Drupal.behaviors.get_searchby = {
      attach: function (context, settings)
      {
        alert('hello');
      }
    };
  }(jQuery, Drupal));
}());
You forgot the library key:

$element['Subject_IDs']['#attached']['library'][] = 'get_libguides_listings/get_searchby';