-
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
A missing/unregistered block in a template crashes the post editor #21718
Comments
Hey thanks for reporting this! - This has been fixed with a specific error message here: #24287 |
I'll reopen this issue as this should be handled better other than having a better message. There is some context for handling this here: #26147 (comment), #26147 (comment) |
Have run into this also, with a block template using a block provided by a plugin, when the plugin got disabled: Causes blank white screen. This really should fail more gracefully, and either just ignore the missing block or have message where block is placed in template that it does not exist. Should not block editor from loading. |
This same thing happened if I try to add a new "block template" in the block editor sidebar. In my case if have disabled the core block "
But if the default template includes a " Removing |
Hi! I create a PR in an attempt to improve the user experience with this issue. I see recent changes have removed the white screen, which is great. In my change I'm looking to mimic the experience of a post edit that is missing a block, and utilize the core/missing block in the createBlock function if a block isn't registered. This keeps the layout intact where blocks are registered, and calls out the block that is not registered within the editor with core/missing block. This is my first contribution to the project, so I'm also looking to learn and open to making any adjustments to improve this code. Thanks! :-) |
My PR above has been merged to trunk, so this ticket can probably be closed now. New user experience retains any registered blocks in a template and uses |
PR link: #37646 Closing this issue! |
Describe the bug
If a post type block template references a block which is not registered, the editor crashes with a whitescreen.
To reproduce
Steps to reproduce the behavior:
Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'n.attributes')
(full trace below)Expected behavior
While this is clearly an error, it would be nice if it were handled better. At the very least, a more descriptive console message would be great. Even better would be to show an error in the standard error boundary template so the rest of the core UI is available.
Screenshots
Editor version (please complete the following information):
Desktop (please complete the following information):
Additional context
Stack trace, in the event that it's helpful:
The text was updated successfully, but these errors were encountered: