From 484acd5bb910de93df2e8f3c9e0b60442f33565b Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Tue, 21 Apr 2026 11:37:00 +0530 Subject: [PATCH 1/2] Script Loader: Defer single-page admin init until DOMContentLoaded. The Connectors and Font Library admin screens register a `-prerequisites` classic-script handle with an empty `src` and attach an inline script that does `import("@wordpress/boot").then(mod => mod.init(...))`. Because the handle has no `src`, only the inline is printed, and it runs as a classic script the moment the parser reaches it. On fast CDN-fronted hosts (WordPress VIP, CloudFront, etc.) in Chrome, `@wordpress/boot` is already ``-ed, so the dynamic import resolves and the module evaluates before the parser has reached the classic deps it relies on (`wp-private-apis`, `wp-components`, `wp-theme`). At its top-level `@wordpress/boot` reads `window.wp.theme.privateApis`, which is still undefined at that point, causing `unlock(undefined)` to throw "Cannot unlock an undefined object". The mount element stays empty and `initSinglePage` / `init` never runs. Wrap the dynamic import in `DOMContentLoaded`. The HTML spec guarantees `DOMContentLoaded` fires only after every parser-blocking classic `