WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

Command Palette: triggering the palette after selecting a block in the Site Editor leads to a fatal error #53898

Closed liviopv closed 1 year ago

liviopv commented 1 year ago

Description

When trying to test out #52509, I noticed a weird behavior where the Site Editor will glitch and show a black screen if you trigger the Command Palette after selecting a block.

The console is logging:

Uncaught TypeError: Cannot read properties of null (reading 'toString')
    at index.js:261:14
    at Array.map (<anonymous>)
    at AI (index.js:249:4)
    at un (command-menu.js:36:39)
    at St (react-dom.min.js?ver=18:1:47627)
    at $s (react-dom.min.js?ver=18:1:120574)
    at Sl (react-dom.min.js?ver=18:1:88649)
    at kl (react-dom.min.js?ver=18:1:88577)
    at bl (react-dom.min.js?ver=18:1:88440)
    at sl (react-dom.min.js?ver=18:1:85264)

It happens when using Cmmd+K or when clicking on the button at the top bar. Triggering the palette in the post/page editor works fine.

Step-by-step reproduction instructions

  1. Open a page or template in the Site Editor
  2. Select a block
  3. Trigger the Command Palette
  4. Type something

Screenshots, screen recording, code snippet

https://github.com/WordPress/gutenberg/assets/14153300/070358e4-6e56-46ef-9314-35c7af87c072

Environment info

WordPress 6.3, GB 16.5

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

liviopv commented 1 year ago

Upon further inspection, it's the same as https://github.com/WordPress/gutenberg/issues/53863 it's ok to close this one

jordesign commented 1 year ago

Tested in WP6.3 and GB16.5 and can confirm this occurs

jordesign commented 1 year ago

But also closing as duplicate 😂