Commit a29e538
Forms: Fix black screen when The Events Calendar is active (#47823)
The wp-build generated page-wp-admin.php uses import("@wordpress/boot")
inside a regular inline script. This relies on the browser importmap
being in the DOM before the inline script executes. However, WordPress
outputs the importmap AFTER regular footer scripts (position 107 vs 100
in the DOM), making it fragile — it works by accident in most setups
due to browser microtask timing.
Plugins like The Events Calendar (via StellarWP) disrupt this timing by
converting scripts to type="module" via script_loader_tag, causing the
import() call to fail and leaving the Forms dashboard as a black screen.
Fix: Replace the inline import() with a two-step approach:
1. A plain global config (window.__jetpackFormsBootConfig) set by the
regular inline script — no module specifiers needed.
2. An inline <script type="module"> printed at priority 20 of
admin_print_footer_scripts (after the importmap at priority 9),
which imports @wordpress/boot and calls initSinglePage with the
config — guaranteed to resolve because modules execute after the
importmap.
The upstream fix will go into @wordpress/build's page-wp-admin.php
template to fix this for all consumers.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent da8f0c3 commit a29e538
2 files changed
Lines changed: 65 additions & 0 deletions
File tree
- projects/packages/forms
- changelog
- src/dashboard
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
62 | 122 | | |
63 | 123 | | |
64 | 124 | | |
| |||
97 | 157 | | |
98 | 158 | | |
99 | 159 | | |
| 160 | + | |
100 | 161 | | |
101 | 162 | | |
102 | 163 | | |
| |||
0 commit comments