-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor crashes with error “TypeError: Cannot read property 'apiVersion' of undefined” #32815
Comments
I tested it with the latest Gutenberg plugin activated and with WordPress 5.8.0. I couldn't reproduce the issue. I see in the code a few places that @glendaviesnz added in #25940 additional checks whether |
I opened #34346 with a changes that check if the The remaining question is whether we want to do anything about WordPress 5.7. We didn't see similar reports before so it's hard to tell if that isn't related to the theme used. It needs to be tested with WordPress 5.7 and the default theme to verify how serious this issue is. |
Current status with WordPress 5.8.1 and Plugin version 11.8.3. The editor no longer crashes. The block which was formerly registered and filled with content is visible, but clicking on it removes everything except a simple, unlabelled control, which allows the user to remove the block. This is a good solution, but the interface needs to show some kind of label to indicate to the user what is happening/what has happened. |
@noisysocks and @Mamaduka, I wanted to flag this issue for your consideration in the context of the upcoming 5.9 release. The last update shared in #32815 (comment) is the only remaining concern. |
I think is Ok, thank you for your assistance! |
Thanks for the ping, @gziolo. We should display a similar message for core blocks as we do for custom ones - #32815 (comment). What do you think? |
On GB trunk on WP 5.8 if I deregister the @markhowellsmead, how did you deregister the block in order to get the empty block toolbar |
|
Note that you have to add the block, save the post, then amend the code to deregister the block which is already placed in the content, then reload the editor. |
I get the same result doing this as when unregistering in the terminal and pasting the block markup into the editor terminal view. Below I add a quote block, then in a plugin add Are you still seeing this error on latest trunk @markhowellsmead? |
Hi, folks I'm removing this issue from WP 5.9 project board since RC1 was released last night. Let's try and land a fix for this in a minor release. |
Thanks, @ndiego. @markhowellsmead, I'm going to close the issue. We shipped several improvements for missing blocks, but feel free to re-open if you encounter new errors. |
Thanks for the feedback. Seems to work and provides the natural error message when a newly-unregistered block is in the block editor. |
Description
If a block is in the post content which is no longer registered, the editor crashes irretrievably with the error message TypeError: Cannot read property 'apiVersion' of undefined.
Step-by-step reproduction instructions
Expected behaviour
I should be able to manually delete the block which is no longer registered.
Actual behaviour
The editor throws the “unexpected error” message and cannot be recovered using any of the available options.
WordPress information
Device information
The text was updated successfully, but these errors were encountered: