[wp-trac] [WordPress Trac] #64342: wp_enqueue_script_module stopped working on 6.9

WordPress Trac noreply at wordpress.org
Wed Dec 3 16:00:57 UTC 2025


#64342: wp_enqueue_script_module stopped working on 6.9
-------------------------------------------+------------------------------
 Reporter:  intdef                         |       Owner:  (none)
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Script Loader                  |     Version:  6.9
 Severity:  major                          |  Resolution:
 Keywords:  needs-patch reporter-feedback  |     Focuses:  javascript
-------------------------------------------+------------------------------

Comment (by intdef):

 The theme used is Divi (Child theme).
 Here is the declaration in my function.php file :


 {{{
  wp_register_script_module('swiper',
 'https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.mjs',
 array('jquery'), null, array());
 // The core GSAP library
     wp_register_script_module( 'gsap',
 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/+esm', array(), null, array());
     // ScrollTrigger - with gsap.js passed as a dependency
     wp_register_script_module( 'gsap/ScrollTrigger',
 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js/+esm',
 array('gsap'), null, array() );
     wp_register_script_module( 'gsap-stext',
 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/SplitText.min.js/+esm',
 array('gsap'), null, array() );
     wp_register_script_module( 'gsap/Flip',
 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/Flip.min.js/+esm',
 array('gsap'), null, array() );

     wp_register_script_module('@barba/core',
 "https://cdn.jsdelivr.net/npm/@barba/core@2.9.7/dist/barba.mjs", array(),
 null, array());
     wp_register_script_module('theme-core', get_stylesheet_directory_uri()
 . '/assets/js/theme-core.js', array(), null, array());

     $dependencies = array(
         [
             'id' => '@barba/core',
         ], [
             'id' => 'gsap',
             'import' => 'static',
         ], [
             'id' => 'gsap/ScrollTrigger',
             'import' => 'dynamic',
         ], [
             'id' => 'gsap/Flip',
             'import' => 'dynamic',
         ], [
             'id' => 'theme-core',
             'import' => 'dynamic',
         ],[
             'id' => 'swiper',
             'import' => 'dynamic',
         ]
     );

     wp_enqueue_script_module( 'numaa-script',
 get_stylesheet_directory_uri() . '/assets/js/main.js', $dependencies, 1.0,
 array(
         'fetchpriority' => 'low',
     ) );
 }}}

 The file that is not loaded is numaa-script. Note that dependencies are
 loaded in the page. The import map is also loaded.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64342#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list