[wp-trac] [WordPress Trac] #64907: Script Modules: Import map can print after classic footer scripts in wp-admin, breaking bare specifier resolution
WordPress Trac
noreply at wordpress.org
Fri Mar 20 17:08:51 UTC 2026
#64907: Script Modules: Import map can print after classic footer scripts in wp-
admin, breaking bare specifier resolution
---------------------------+-------------------------
Reporter: mlaetitia | Owner: mcsf
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 7.0
Component: Script Loader | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: javascript
---------------------------+-------------------------
Changes (by mcsf):
* owner: (none) => mcsf
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"62080" 62080]:
{{{
#!CommitTicketReference repository="" revision="62080"
Script Loader: Print import map before classic scripts.
Should any scripts contain calls to `import()`, the browser won't be able
to resolve bare import specifiers unless the import map is already in the
DOM. Thus, rather than rely on hook registration order, which is fallible,
ensure that the newer callback `WP_Script_Modules::print_import_map`
(since 6.5.0) has a lower priority than `_wp_footer_scripts`.
Reviewed by jonsurrell.
Props mlaetitia.
Fixes #64907.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64907#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list