Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.41k stars 1.98k forks source link

Bug: Post/Page Editor crashes when triggering Command Palette when a block is selected #81005

Closed liviopv closed 1 year ago

liviopv commented 1 year ago

Quick summary

This is a WordPress.com-specific variation of https://github.com/WordPress/gutenberg/issues/53863.

While the bug in the core is only reproducible in the Site Editor, in WordPress.com, when GB 16.5 is active, the Post/Page Editor also crashes when the Command Palette is triggered when a block is selected. The symptoms is a little different: instead of a black screen with no error message like in the Site Editor, the Post Editor shows the regular Gutenberg fatal error screen, with the options to "Copy Post Test" and "Copy error".

The error logs:

TypeError: Cannot read properties of null (reading 'toString')
    at https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/block-editor/index.min.js?m=1692812195i&ver=af7c44e3d3ac232a7bfc:145:63
    at Array.map (<anonymous>)
    at AI (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/block-editor/index.min.js?m=1692812195i&ver=af7c44e3d3ac232a7bfc:143:1361)
    at un (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/commands/index.min.js?m=1692812195i&ver=837a8c80dd33e3db66e1:1:42581)
    at St (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/vendors/react-dom.min.js?m=1692812195i&ver=18:1:47627)
    at $s (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/vendors/react-dom.min.js?m=1692812195i&ver=18:1:120574)
    at Sl (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/vendors/react-dom.min.js?m=1692812195i&ver=18:1:88649)
    at kl (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/vendors/react-dom.min.js?m=1692812195i&ver=18:1:88577)
    at bl (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/vendors/react-dom.min.js?m=1692812195i&ver=18:1:88440)
    at sl (https://s0.wp.com/wp-content/plugins/gutenberg-core/v16.5.0/build/vendors/react-dom.min.js?m=1692812195i&ver=18:1:85264)

https://github.com/Automattic/wp-calypso/assets/14153300/ada3610b-062a-4081-9217-ea09b31830fe

Steps to reproduce

  1. Open a new post
  2. Add an image block (or any other block)
  3. Select the block
  4. Type Cmmd+K to trigger the Command Palette

What you expected to happen

This is the behavior of the Post Editor in a local site with GB 16.5

https://github.com/Automattic/wp-calypso/assets/14153300/57674cbc-1499-4d9e-9295-db0ddd233710

What actually happened

The editor glitches and shows the following:

CleanShot 2023-08-24 at 09 47 40@2x

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Simple, Atomic, Self-hosted

Logs or notes

Chrome 115.0, Mac OS Ventura

liviopv commented 1 year ago

Closing. I was able to reproduce this scenarion in core as well https://github.com/WordPress/gutenberg/issues/53863#issuecomment-1691319351