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

Gutenberg crashes on 9.2.0 when clicking on a block or inserting a block #26381

Closed
arjendejong12 opened this issue Oct 22, 2020 · 8 comments · Fixed by #26484
Closed

Gutenberg crashes on 9.2.0 when clicking on a block or inserting a block #26381

arjendejong12 opened this issue Oct 22, 2020 · 8 comments · Fixed by #26484
Labels
Needs Testing Needs further testing to be confirmed. [Status] Needs More Info Follow-up required in order to be actionable.

Comments

@arjendejong12
Copy link
Contributor

Describe the bug
Clicking on blocks or trying to add a block via de inserter causes Gutenberg to crash with the following error stack trace:

Error: An error occurred while running 'mapSelect': u.substr is not a function
The error may be correlated with this previous error:
TypeError: u.substr is not a function
    at v (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-serialization-default-parser/index.js?ver=7110f347451a9a2bcae6223b180b96dd:1:3536)
    at b (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-serialization-default-parser/index.js?ver=7110f347451a9a2bcae6223b180b96dd:1:2843)
    at p (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-serialization-default-parser/index.js?ver=7110f347451a9a2bcae6223b180b96dd:1:2342)
    at Gr (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/blocks/index.js?ver=97c5495cbfb44eab0e216227afed9391:13:36982)
    at https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-editor/index.js?ver=feebd7dffa288c5eabfc28da06543146:25:51819
    at u (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-editor/index.js?ver=feebd7dffa288c5eabfc28da06543146:1:10419)
    at i (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-editor/index.js?ver=feebd7dffa288c5eabfc28da06543146:25:49769)
    at Array.map (<anonymous>)
    at https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-editor/index.js?ver=feebd7dffa288c5eabfc28da06543146:25:50158
    at u (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/block-editor/index.js?ver=feebd7dffa288c5eabfc28da06543146:1:10419)

Original stack trace:
    at Xe (https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/data/index.js?ver=a0effe22ca5a445ba9c4ee384cdf7853:1:28482)
    at https://scriptware.mediasoep.nl/content/plugins/gutenberg/build/data/index.js?ver=a0effe22ca5a445ba9c4ee384cdf7853:1:29038
    at we (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:84:293)
    at He (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:97:464)
    at zj (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:228:406)
    at Th (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:152:223)
    at tj (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:152:152)
    at Te (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:146:151)
    at https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:61:68
    at unstable_runWithPriority (https://scriptware.mediasoep.nl/content/plugins/gutenberg/vendor/react.min.e713ea3b.js:25:260)

This only happens on 9.2.0. Downgrading to 9.1.0 fixes the issue. It happens on every block, not a specific one.

To reproduce
Steps to reproduce the behavior:

  1. Open or create a post/page.
  2. Click on a block, or on the + for the inserter.
  3. See Gutenberg crashing.

Expected behavior
Clicking a block or inserting one should just work.

Editor version (please complete the following information):

  • WordPress version: 5.5.1
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Plugin
  • If the Gutenberg plugin is installed, which version is it? 9.2.0

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 88.0.4292.2
@talldan
Copy link
Contributor

talldan commented Oct 23, 2020

@arjendejong12 A patch, 9.2.1, was released for the plugin, does that help with your issue?

@arjendejong12
Copy link
Contributor Author

@talldan Unfortunately it still happens with 9.2.1.

@HelloFromNL
Copy link

Similar problem

@talldan
Copy link
Contributor

talldan commented Oct 26, 2020

@arjendejong12 @fotovat Would you be able to share the plugins and theme do you have active?

Not saying it isn't a Gutenberg bug, but it seems like it must be triggered by something specific to your WordPress environments, as it's not happening in the vanilla Gutenberg dev environment and there don't seem to have been any other reports of the issue.

@talldan talldan added [Status] Needs More Info Follow-up required in order to be actionable. Needs Testing Needs further testing to be confirmed. labels Oct 26, 2020
@HelloFromNL
Copy link

WordPress 5.5.1
Twenty Twenty theme
Gutenberg 9.2.1 without any other plug in
SiteGround hosting tested with PHP 7.4 and 7.3

I tested on staging site in local environment by MAMP Pro PHP 7.3 and there is no problem.

@talldan
Copy link
Contributor

talldan commented Oct 27, 2020

@arjendejong12 @fotovat This looks like it could be the fix for your issue - #26484

I tested an empty reusable block and the console error message matched yours.

If you can check your Reusable blocks (wp-admin/edit.php?post_type=wp_block) to see if there are any empty, and if so that would confirm the bug. As a workaround you can also remove or update any empty reusable blocks to be non-empty, and that should also help.

@arjendejong12
Copy link
Contributor Author

@talldan This PR fixes my issue. I had an empty reusable block and when I deleted that, the bug didn't occur. With an empty block and this fix, the bug also doesn't occur.

@talldan talldan linked a pull request Oct 27, 2020 that will close this issue
@talldan
Copy link
Contributor

talldan commented Oct 27, 2020

Great, glad we tracked that down 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed. [Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants