This Block Contains Unexpected or Invalid Content
-
I am part of a team working on a large scale multisite WordPress project that makes heavy use of Gutenberg blocks.
As is well known amongst Gutenberg developers, you’ll often see “This Block Contains Unexpected or Invalid Content” in the editor after making changes to the block’s attributes and/or HTML markup.
This error is usually resolved by clicking “Attempt Block Recovery”, but our design team has
deemed that presenting this error to the (non-developer) user every time there is a block update is not acceptable.We use common blocks across the site which may occur many times throughout the site, meaning the “Attempt Block Recovery” must be clicked manually on every block in the backend site-wide. This ends up creating a frustrating and tedious user experience for content editors.
It seems to me that the only safeguard we have for this is making use of the deprecation system, but the deprecation system over multiple updates gets extremely messy, bloated and confusing to work with (especially with large complex blocks like the custom ones we have developed).
We have found that this poses a long term problem for both users and developers.
This leads me to a couple questions:
1) Is there any hope of eliminating or reducing “This Block Contains Unexpected or Invalid Content” errors when blocks receive updates?
2) Is there a better alternative than using the deprecation system?
3) Even though its probably a bad idea, is there a setting to automatically attempt block recovery after updates are pushed?If it helps, here is some project info:
– We are using the latest versions of WordPress & Gutenberg
– The project is bootstrapped with create-guten-block ( https://github.com/ahmadawais/create-guten-block ).
– The project is a multi-site instanceThanks for reading and let me know if there is any more information or context I can provide on this problem.
- The topic ‘This Block Contains Unexpected or Invalid Content’ is closed to new replies.