Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting Table block within a Group to reusable block causes Gutenberg editor to crash #27243

Closed
cathymcbride opened this issue Nov 24, 2020 · 5 comments · Fixed by #29059
Closed
Assignees
Labels
[Block] Table Affects the Table Block [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@cathymcbride
Copy link

Describe the bug
Gutenberg editor crashes when converting table within a group to reusable block

Steps to reproduce the behavior:

  1. Add new post.
  2. Add Group block.
  3. Add Table block with any number of rows and columns within the Group block.
  4. Save draft.
  5. Return to Posts management page.
  6. Reopen the draft.
  7. Click on a table cell to bring up the toolbar.
  8. Click on the kebab menu.
  9. Click on Add to Reusable block.

Expected behavior
Table is converted into a reusable block.

Actual behavior
editor crashes (see stack trace below)

Screenshots
If applicable, add screenshots to help explain your problem.

Editor version (please complete the following information):

  • WordPress version: [e.g: 5.3.2] 5.5.3
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? "gutenberg plugin",
  • If the Gutenberg plugin is installed, which version is it? 9.4.1

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS
  • Browser: not browser specific - reproed on chrome, safari and firefox

Additional context

Stack trace:
Error: An error occurred while running 'mapSelect': Cannot read property 'name' of null
The error may be correlated with this previous error:
TypeError: Cannot read property 'name' of null
at Object.current (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=fdb8c27842d6665c8f717ab07efd9458:46:2298)
at e (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:28762)
at https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:28927
at https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:23198
at Array.forEach ()
at o (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:23170)
at https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:20382
at p (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:11415)
at https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/redux-routine/index.js?ver=465b7310eb6f6a685e44cf8c6c5ce817:1:9762
at https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:14089

Original stack trace:
at Fe (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/data/index.js?ver=152d217f4cbf8a22c88dc20c16e8d8c1:1:28554)
at Qs (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=fdb8c27842d6665c8f717ab07efd9458:46:2160)
at we (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:84:293)
at He (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:97:464)
at zj (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:228:406)
at Th (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:152:223)
at tj (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:152:152)
at Te (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:146:151)
at https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:61:68
at unstable_runWithPriority (https://modern-eagle.jurassic.ninja/wp-content/plugins/gutenberg/vendor/react.min.e713ea3b.js:25:260)

@annezazu annezazu added [Block] Table Affects the Table Block [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) Needs Testing Needs further testing to be confirmed. labels Nov 25, 2020
@talldan
Copy link
Contributor

talldan commented Nov 25, 2020

Initially I was unable to reproduce this in my dev environment, but then I pulled the latest code from master and was able to reproduce it. It must be something very recently introduced. Here's an non-minified stack trace:

The above error occurred in the <BlockStyles> component:
    in BlockStyles (created by BlockInspector)
    in div (created by PanelBody)
    in PanelBody (created by BlockInspector)
    in div (created by BlockInspector)
    in div (created by BlockInspector)
    in BlockInspector
    in Unknown (created by WithSelect(BlockInspector))
    in WithSelect(BlockInspector) (created by SettingsSidebar)
    in div (created by ForwardRef(Panel))
    in ForwardRef(Panel) (created by ComplementaryArea)
    in div (created by ComplementaryAreaFill)
    in SlotComponent (created by Context.Consumer)
    in Slot (created by Slot)
    in Slot (created by ComplementaryAreaSlot)
    in ComplementaryAreaSlot (created by Layout)
    in div (created by ForwardRef(InterfaceSkeleton))
    in div (created by ForwardRef(InterfaceSkeleton))
    in div (created by ForwardRef(InterfaceSkeleton))
    in div (created by ForwardRef(InterfaceSkeleton))
    in ForwardRef(InterfaceSkeleton) (created by Layout)
    in div (created by FocusReturnProvider)
    in FocusReturnProvider (created by Layout)
    in Layout (created by Editor)
    in ErrorBoundary (created by Editor)
    in BlockEditorProvider
    in Unknown (created by Context.Consumer)
    in WithRegistryProvider(BlockEditorProvider) (created by EditorProvider)
    in BlockContextProvider (created by EditorProvider)
    in EntityProvider (created by EditorProvider)
    in EntityProvider (created by EditorProvider)
    in EditorProvider (created by WithDispatch(EditorProvider))
    in WithDispatch(EditorProvider)
    in Unknown (created by WithSelect(WithDispatch(EditorProvider)))
    in WithSelect(WithDispatch(EditorProvider))
    in Unknown (created by Context.Consumer)
    in WithRegistryProvider(WithSelect(WithDispatch(EditorProvider))) (created by Editor)
    in div (created by DropZoneProvider)
    in DropZoneProvider (created by Editor)
    in SlotFillProvider (created by SlotFillProvider)
    in SlotFillProvider (created by Editor)
    in StrictMode (created by Editor)
    in Editor (created by WithDispatch(Editor))
    in WithDispatch(Editor)
    in Unknown (created by WithSelect(WithDispatch(Editor)))
    in WithSelect(WithDispatch(Editor))

@talldan talldan added [Type] Regression Related to a regression in the latest release and removed Needs Testing Needs further testing to be confirmed. labels Nov 25, 2020
@talldan
Copy link
Contributor

talldan commented Nov 25, 2020

When testing to see if this is a regression in 5.6, I was able to reproduce in both 5.5.3 and 5.6 with the plugin disabled, so maybe not a recent issue.

Not sure why I couldn't repro it at first. 🤔

@noisysocks noisysocks added [Type] Bug An existing feature does not function as intended and removed [Type] Regression Related to a regression in the latest release labels Jan 6, 2021
@talldan talldan added [Type] Regression Related to a regression in the latest release and removed [Type] Bug An existing feature does not function as intended labels Feb 17, 2021
@TimothyBJacobs
Copy link
Member

For #29055 at least, I wasn't able to reproduce on 5.6.

@talldan
Copy link
Contributor

talldan commented Feb 17, 2021

I think it seems to happen with any block that has block styles when the sidebar is opened. The steps i'm using to reproduce:

  1. Create a new post
  2. Add a quote block
  3. Save the post
  4. Reload
  5. Convert the quote to a reusable block
  6. 💥

It looks like after the quote block has been removed and made reusable, the sidebar is still momentarily trying to show the block styles for it. The exception happens because the quote block no longer exists.

@talldan
Copy link
Contributor

talldan commented Feb 17, 2021

#29059 should fix it, but it's an unusual one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
5 participants