Skip to content

Social: fix blank Social admin page on WordPress 6.9.x - #49654

Merged
gmjuhasz merged 2 commits into
trunkfrom
fix/jetpack-1716-publicize-bundle-wp-deps
Jun 22, 2026
Merged

gmjuhasz merged 2 commits into
trunkfrom
fix/jetpack-1716-publicize-bundle-wp-deps

Conversation

@alinclamba

@alinclamba alinclamba commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes: JETPACK-1716 — the Jetpack Social admin page (Jetpack → Social) renders blank on WordPress 6.9.x.

Bug

Linear: JETPACK-1716

Since Jetpack 15.9, on sites running WordPress 6.9.x, Jetpack → Social renders blank. Connections stay healthy and posts still auto-share (that path is server-side), so it presents as an admin-UI-only failure. Reported across three Zendesk tickets and several WordPress.org forum threads; the only workaround so far has been upgrading to WordPress 7.0.

Root cause

@wordpress/theme arrives transitively via @wordpress/ui. With the default build config it is externalized into the script handle wp-theme, which is registered in WordPress 7.0 but not in 6.9.x. WordPress silently refuses to enqueue a script whose declared dependency handle is unregistered, so the Social bundle never loads. No console error is thrown (the script simply is not enqueued), which matches the "blank page, nothing red in console" reports.

What changed

projects/packages/publicize/webpack.config.js: split the entry points so dependency extraction differs by surface.

  • social-admin-page (standalone admin page): bundle @wordpress/theme and @wordpress/private-apis inline, so the page renders on WP 6.9.x. They are bundled jointly so @wordpress/theme's module-init lock() lands on the same private-apis consent map (same pattern as Boost / Jetpack AI admin / Search dashboard, PR Components: Migrate remaining Notice consumers to @wordpress/ui #48173). This is safe here because the admin page is standalone, with no other script sharing a canonical private-apis instance.
  • block-editor-jetpack, block-editor-social, classic-editor: keep externalizing both (unchanged). These load inside the block editor and must share WordPress's canonical private-apis instance; bundling a second copy inline breaks lock()/unlock() across bundles (Cannot unlock an object that was not locked before).

Scope / known limitation (follow-up for the Social team)

This PR fixes the blank Social admin page on WP 6.9.x, the primary symptom in every ticket.

It does not restore the editor's per-post "Share to social media" controls on WP 6.9.x. Those controls live in the block-editor bundles, which still need the wp-theme handle that WP 6.9.x lacks, and that bundle cannot inline @wordpress/theme without breaking the shared private-apis instance (see above). Restoring them on old WP needs deeper work, e.g. registering a wp-theme shim for older WP or decoupling the editor bundle from @wordpress/theme. This is the same behaviour as the current release on 6.9.x (no regression), and is worth a follow-up owned by the Social team.

Testing instructions

Tested on a JN sandbox rolled back to WordPress 6.9.4 (standalone Jetpack Social plugin):

  • Confirmed wp-theme is not registered on WP 6.9.4 (wp_script_is( 'wp-theme', 'registered' ) returns false).
  • Before: Jetpack → Social is blank (content area empty, no console error).
  • After: Jetpack → Social renders the full dashboard.
  • Verified the built social-admin-page.asset.php no longer lists wp-theme (inlined), while block-editor-*.asset.php still list it (externalized, unchanged).
  • Verified the editor no longer throws Cannot unlock ... (an issue an earlier iteration of this PR introduced and this version resolves). On WP 6.9.x the editor Social panel remains absent, as in the current release.

Not tested: single-plugin layouts (the sandbox had both the main Jetpack plugin and the standalone Social plugin active), and WordPress versions other than 6.9.4.

Screenshots

Before (WP 6.9.4, Social admin page blank):

before-social-admin-wp694

After (fix applied, Social dashboard renders):

after-social-admin-wp694

Console note (not a regression)

On the test site the console shows Store "jetpack-connection" is already registered. This is a dual-plugin test-environment artifact: the sandbox has both the main jetpack plugin and the standalone jetpack-social plugin active at once, each registering the jetpack-connection store. It does not occur on a real site running one of the two, and it is not related to this change.

Does this pull request change what data or activity we track or use?

No.

Reviewed locally

Reviewed with /jetpack-review-pr before flipping to ready. The fix area was re-scoped after CI E2E (editor + Social) flagged a regression in the first iteration; this version is verified against those surfaces on JN. Local lint/tests rely on CI (this clone's node_modules is mid-reinstall).


Notes

This PR was created during Bug Blitz via the jetpack-bug-blitz Claude skill. The fix was authored with Claude Code assistance by a Happiness Engineer who encounters this bug in support tickets.

#jetpack-happy-ai-updates

@github-actions

github-actions Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/jetpack-1716-publicize-bundle-wp-deps branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/jetpack-1716-publicize-bundle-wp-deps

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 16, 2026
@alinclamba alinclamba added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jun 16, 2026
@jp-launch-control

jp-launch-control Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@alinclamba alinclamba self-assigned this Jun 16, 2026
On WP 6.9.x the publicize build externalized @wordpress/theme into the
wp-theme script handle, which only exists in WP 7.0. WordPress silently
skips enqueuing a script whose dependency handle is unregistered, so the
standalone Jetpack Social admin page rendered blank (auto-sharing, being
server-side, kept working).

Bundle @wordpress/theme and @wordpress/private-apis inline for the
social-admin-page entry only, so that standalone page renders on 6.9.x.
The block-editor entries keep externalizing both: they load inside the
block editor and must share WordPress's canonical private-apis instance,
so inlining a second copy there breaks lock()/unlock() across bundles.

Fixes: https://linear.app/a8c/issue/JETPACK-1716
@alinclamba
alinclamba force-pushed the fix/jetpack-1716-publicize-bundle-wp-deps branch from ec02874 to 892d9e2 Compare June 16, 2026 09:59
@alinclamba alinclamba changed the title Social: fix blank admin page and missing editor controls on WordPress 6.9.x Social: fix blank Social admin page on WordPress 6.9.x Jun 16, 2026
@alinclamba
alinclamba marked this pull request as ready for review June 16, 2026 10:21
@alinclamba
alinclamba requested a review from manzoorwanijk June 16, 2026 10:22
@gmjuhasz
gmjuhasz requested a review from Copilot June 16, 2026 11:08
@manzoorwanijk

Copy link
Copy Markdown
Member

This is the only change we need to fix the issue.

diff --git a/projects/packages/publicize/webpack.config.js b/projects/packages/publicize/webpack.config.js
index 00b62de959b..9e40800846f 100644
--- a/projects/packages/publicize/webpack.config.js
+++ b/projects/packages/publicize/webpack.config.js
@@ -17,7 +17,14 @@ const socialWebpackConfig = {
 	},
 	node: false,
 	plugins: [
-		...jetpackWebpackConfig.StandardPlugins(),
+		...jetpackWebpackConfig.StandardPlugins( {
+			DependencyExtractionPlugin: {
+				requestMap: {
+					'@wordpress/theme': { external: false },
+					'@wordpress/private-apis': { external: false },
+				},
+			},
+		} ),
 		// Service-walkthrough illustrations referenced by
 		// `_inc/components/services/utils.tsx` via runtime URLs (so the
 		// chassis esbuild pipeline, which doesn't configure a binary

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a Jetpack Social admin UI regression on WordPress 6.9.x where the Jetpack → Social page rendered blank due to an unregistered wp-theme dependency handle preventing the admin bundle from enqueuing.

Changes:

  • Split Publicize’s webpack config into two compiler configs so dependency extraction can differ by surface.
  • For the standalone Social admin page bundle, inline-bundle @wordpress/theme and @wordpress/private-apis to avoid the missing wp-theme handle on WP 6.9.x.
  • Add a changelog entry documenting the fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/packages/publicize/webpack.config.js Splits entrypoints and adjusts dependency extraction so the Social admin page can load on WP 6.9.x.
projects/packages/publicize/changelog/fix-jetpack-1716-social-blank-wp69 Adds a patch-level changelog entry for the blank Social admin page fix.

@alinclamba

Copy link
Copy Markdown
Contributor Author

Thanks @manzoorwanijk! Gentle heads-up in case it helps: I actually tried that exact version first, and it tripped the post-editor and Social E2E tests, which is why I ended up splitting it so only the admin-page bundle inlines. Could be something I missed, you know this code far better than me, so totally your call on the final approach, just wanted to mention this. Thanks for for looking into it!

@manzoorwanijk manzoorwanijk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine as a fix for Social admin page, but I will leave the build tooling changes to @anomiex for review.

Thank you for taking this up.

@anomiex anomiex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any comments that would block merging this. Updating the changelog entry would be a good idea though.

I don't know whether enabling devServer for the classic-editor entry point is fixing an old oversight or is undoing something that was intentional in the past.

I also stand by my statement in Slack that it would be better to have a centralized polyfill for the missing script than to bundle @wordpress/theme and such in half a dozen different bundles. But I don't think it would be worthwhile to hold up this fix on someone refactoring everything to do that instead.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@gmjuhasz gmjuhasz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue keeps popping up for users, so I think we should merge this and think of a followup in terms of @anomiex suggestion

@alinclamba

Copy link
Copy Markdown
Contributor Author

This issue keeps popping up for users, so I think we should merge this and think of a followup in terms of @anomiex suggestion

Thanks @gmjuhasz ! Feel free to merge when ready, this is blocking several support tickets, indeed!

@gmjuhasz
gmjuhasz merged commit cb65288 into trunk Jun 22, 2026
79 checks passed
@gmjuhasz
gmjuhasz deleted the fix/jetpack-1716-publicize-bundle-wp-deps branch June 22, 2026 09:14
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Jun 22, 2026
robertsreberski pushed a commit that referenced this pull request Jun 24, 2026
…ordPress 6.9.x (#49859)

* Revert "Social: fix blank Social admin page on WordPress 6.9.x (#49654)"

This reverts commit cb65288.

* Register WP build polyfills for the legacy admin page and editor

* Social: request only the wp-theme / wp-private-apis polyfills the bundles use

Per review: the shared helper for the Social bundles (editor + legacy admin
page) now requests only wp-theme and wp-private-apis instead of the full
SCRIPT_HANDLES + MODULE_IDS set, so the polyfill's wp-private-apis force-
replacement never touches handles Social doesn't need (e.g. wp-notices).

The wp-build chassis dashboard keeps its own full registration -- it genuinely
uses the @wordpress/boot|route|a11y modules, wp-notices, and wp-views.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Publicize Now Jetpack Social, auto-sharing [Package] Publicize

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants