Skip to content

Comments: Fix the comment editor crashing on paragraphs, lists, quotes, and code - #53658

Merged
arcangelini merged 1 commit into
trunkfrom
fix/comments-editor-align-crash
Oct 15, 2026
Merged

arcangelini merged 1 commit into
trunkfrom
fix/comments-editor-align-crash

Conversation

@arcangelini

@arcangelini arcangelini commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

  • Stop stubbing the constrained layout in the comment editor bundle. Since the block-editor 18.1 bump in Update wordpress monorepo #53004, the align toolbar looks up constrained for every block with align support. The stub made that lookup return undefined, so paragraphs, lists, quotes, and code blocks crashed with Cannot read properties of undefined (reading 'name') once selected.
  • Replace Gutenberg's per-block crash boundary with a passthrough. It swallowed block crashes and showed "This block has encountered an error and cannot be previewed", so the editor never fell back to the plain textarea. Now any block crash reaches the editor's own boundary, which brings the textarea back and logs the error.

The editor chunk grows by about 7.6 KB. Expect more jetpack_comments_editor_error events with stage: render after deploy, since these crashes now get logged.

Related product discussion/links

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

No.

Testing instructions

  • Build the package: jp build packages/comments.
  • On a site using the new comment form, open a post and click into the comment box.
  • Before: the box shows "This block has encountered an error and cannot be previewed" and the console logs the TypeError.
  • After: the editor loads. Type a paragraph, then - for a list, > for a quote, and ``` for code. Each block renders with no warning and no console error.
  • To check the fallback, add 'constrained' back to the layouts list in projects/packages/comments/tools/editor-stubs.js, rebuild, and click into the comment box. The editor should go away and the plain textarea should come back, editable.

@arcangelini arcangelini added [Status] Needs Review This PR is ready for review. [Type] Bug labels Oct 15, 2026
@arcangelini arcangelini self-assigned this Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 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 or WordPress.com Site Helper), and enable the fix/comments-editor-align-crash branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/comments-editor-align-crash
bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/comments-editor-align-crash

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

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!

@jp-launch-control

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

@arcangelini
arcangelini merged commit 653b91f into trunk Oct 15, 2026
92 of 94 checks passed
@arcangelini
arcangelini deleted the fix/comments-editor-align-crash branch October 15, 2026 11:46
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant