[wp-trac] [WordPress Trac] #65103: Single-page admin screens (Connectors, Font Library) fail to mount in Chrome when @wordpress/boot wins a race against its classic-script deps
WordPress Trac
noreply at wordpress.org
Wed Apr 22 04:55:52 UTC 2026
#65103: Single-page admin screens (Connectors, Font Library) fail to mount in
Chrome when @wordpress/boot wins a race against its classic-script deps
-------------------------------------------------+-------------------------
Reporter: fabiankaegy | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 7.0
Component: Script Loader | Version: trunk
Severity: normal | Resolution:
Keywords: script-modules has-patch changes- | Focuses:
requested | administration
-------------------------------------------------+-------------------------
Changes (by westonruter):
* keywords: script-modules has-patch => script-modules has-patch changes-
requested
Comment:
Let's avoid committing minified JS and lean into modern JS syntax (e.g.
const and async/await).
For example, using the JS code in the PR, this is much easier to read and
debug, thanks to IDEs being able to do syntax checking (although Trac
doesn't do syntax highlighting of the JS):
{{{#!php
<?php
$init_js_function = <<<JS
( mountId, routes ) => {
const run = async () => {
const mod = await import( "@wordpress/boot" );
mod.initSinglePage( { mountId, routes } );
};
if ( document.readyState === "loading" ) {
document.addEventListener( "DOMContentLoaded", run
);
} else {
run();
}
}
JS;
wp_add_inline_script(
$mount_id . '-prerequisites',
sprintf(
'( %s )( %s, %s )',
$init_js_function,
wp_json_encode( $mount_id ),
wp_json_encode( $routes, JSON_HEX_TAG |
JSON_UNESCAPED_SLASHES )
)
);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65103#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list