The dependency core/jquery.ui is not loading into the theme. jQuery is loaded as it is included by default but jquery.ui refuses to load.
#theme.libraries.yml popup: version: 1.x js: js/popup.js: {} dependancies: - core/jquery - core/jquery.ui
#theme.info.yml libraries: - theme/popup
I have also tried attaching the library using the code below, but still no luck.
// theme.theme function theme_page_attachments_alter(&$page) { $route = \Drupal::routeMatch()->getRouteObject(); $is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route); if(!$is_admin) { $page['#attached']['library'][] = 'theme/popup'; } }
I have seen multiple references to core/jquery.ui throughout drupals files. So am a little confused.
I feel like i must be missing something obvious.
jQuery UI will load in fine if you are logged in, but again i believe this is included by default for admin users.