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

WordPress Trac noreply at wordpress.org
Wed Dec 3 17:59:29 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 close  |     Focuses:  javascript
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * keywords:  needs-patch reporter-feedback => needs-patch reporter-feedback
     close


Comment:

 Replying to [comment:4 mindctrl]:
 > It's my understanding that script modules can't rely on classic scripts
 like jQuery, which you have as a dependency on `swiper`. See the
 Limitations section here: https://make.wordpress.org/core/2024/03/04
 /script-modules-in-6-5/

 This is correct. The `jquery` dependency is ''not'' a script module but
 rather a classic script, so it is a missing dependency.

 In #60647 there was an idea to allow script modules to be able to depend
 on scripts, but this didn't end up shipping (although the ticket title
 seems to not have been updated to reflect what ended up landing, cc
 @jonsurrell). There is a converse ticket for allowing scripts to depend on
 script modules in #61500.

 In any case, it is in fact the case that with 6.9, the behavior of script
 modules changed so that they will not print if there is any unregistered
 dependency. This brings script modules in line with `WP_Scripts` in which
 an enqueued script will not print if a dependency is missing. This caused
 confusion during during beta/RC and led to the creation of #64229 to warn
 when a script, style, or script module is enqueued with a missing
 dependency. See that ticket for more details. I had planned for this to be
 part of 7.0, but given the potential for unexpected breakage, I'll re-
 milestone for 6.9.1.

 I think otherwise that this ticket can be closed.

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


More information about the wp-trac mailing list