[wp-trac] [WordPress Trac] #64812: Scripts: wp_enqueue_registered_block_scripts_and_styles() does not include modules
WordPress Trac
noreply at wordpress.org
Thu Mar 5 12:14:49 UTC 2026
#64812: Scripts: wp_enqueue_registered_block_scripts_and_styles() does not include
modules
---------------------------+-----------------------------
Reporter: jonsurrell | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 6.5
Severity: normal | Keywords: good-first-bug
Focuses: javascript |
---------------------------+-----------------------------
The `wp_enqueue_registered_block_scripts_and_styles()`
[https://github.com/WordPress/wordpress-
develop/blob/0dc7dffd31eb038b780ca9a0c65e2bcda98a9393/src/wp-includes
/script-loader.php#L2736-L2781 function] enqueues block scripts and
styles. However, it does not include script modules.
The entire function depends on `wp_should_load_block_assets_on_demand()`.
If that function returns `true`, then not enqueuing anything is the
correct behavior.
However, if block assets should be loaded ''eagerly'', then a block's
script modules should also be enqueued.
This can break blocks that depend on modules for sites and themes that
depend on eagerly loading block assets.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64812>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list