I think I'm misunderstanding how to get core optional js libraries to load on a page
I'm trying and failing to incorporate a JQuery UI slide effect
Inspecting my page source I can see that:
My hello_world.js is loading.
JQuery and JQuery.ui are loading
JQuery.effects.core and JQuery.effects.slide are not.
What am I doing wrong?

hello_world.libraries.yml

hello_world:
  js:
    js/hello_world.js: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.ui
    - core/jquery.ui.effects.core
    - core/jquery.ui.effects.slide
    - core/jquery.once

Comments

jaypan’s picture

JQuery.effects.core and JQuery.effects.slide are not.

Maybe because you wrote jquery.ui.effects.core and jquery.ui.effects.slide?

Contact me to contract me for D7 -> D10 migrations.

Jeff Burnz’s picture

You should only really need to set:

- core/jquery.ui.effects.slide

...because jquery.ui.effects.core is a dependancy of that library and will load automatically.

Remember the files are actually called:

effect-min.js // jquery.ui.effects.core lib
effect-slide-min.js // jquery.ui.effects.slide lib

I just tested loading only - core/jquery.ui.effects.slide and both loaded up first time (of course clear cache etc).

jwaxman’s picture

Thanks again! Got it now.