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

Block inserter - The editor has encountered an unexpected error - Chrome problem #28

Closed
bobbingwide opened this issue Mar 25, 2019 · 6 comments
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Mar 25, 2019

I'm raising this here while I figure out if this is a bug with WordPress 5.1 or something else.

Having upgraded to WordPress 5.1.1, I now get problems with Add new.
Almost immediately the message box saying "The editor has encountered an unexpected error." appears.

The console log reveals...

Uncaught TypeError: Cannot read property 'prefix/block_name' of undefined
    at getInsertUsage (editor.js:12344)
    at buildBlockTypeInserterItem (editor.js:12493)
    at Array.map (<anonymous>)
    at editor.js:12543
    at callSelector (editor.js:829)
    at runSelector (data.js:709)
    at editor.js:18325
    at getNextMergeProps (data.js:1738)
    at new ComponentWithSelect (data.js:1756)
    at constructClassInstance (react-dom.js:12604)

where prefix/block_name is the name of the Most Used registered block.
Sometimes it's oik-block/github, but when I deactivate the plugin that registers it, it's core/paragraph.

The problem is only a problem for one subdomain, in a local installation of wp-a2z.org.
The local domain is blocks.wp.a2z

The problem occurs on Chrome Version 73.0.3683.86 (Official Build) (64-bit)
It does not happen with Firefox or Edge.

Problem appeared to be resolved after clearing the cache but came back very quickly when I reactivated my own plugin. The block name appearing in the message changed back to "oik-block/github". Previously, when the only routine registering blocks was WordPress core the block name was "core/paragraph".

@bobbingwide
Copy link
Owner Author

Reverted to WordPress 5.1 and got the same problem.

@bobbingwide
Copy link
Owner Author

Looking at Local storage for https://blocks.wp.a2z I see
image

whereas for https://blocks.wp-a2z.org it's
image

I don't understand what this data is but I'll delete the local storage in my development server and see if the problem goes away.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Mar 26, 2019

@bobbingwide
Copy link
Owner Author

bobbingwide commented Mar 26, 2019

I was initially unable to reproduce the problem using Chrome on my iPad.
I realised that the problem only occurs after you’ve used Gutenberg 5.3 in the browser of your choice.
Gutenberg has to have the opportunity to set Core/block-editor preferences insertUsage to an empty array.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Mar 29, 2019

I'm going to leave this open until - retested on 15th Jan

  • the fixes for Gutenberg issue 14580 have been released,
  • I've applied the updates - now using Gutenberg 7.1 then 7.2
  • and have retried deactivating Gutenberg
  • and successfully created new posts and edited posts using my iPad: Safari and Chrome.

Incidentally, while looking at a problem with the Divi theme I came across a plugin that I could possibly use to fix the issues on my iPad. https://github.com/jonathanbossenger/clear-divi-page-builder-cache

Sorry, something went wrong.

@bobbingwide
Copy link
Owner Author

I updated the previous comment. Closing issue now.

@bobbingwide bobbingwide self-assigned this Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant