-
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
Navigation block: "This block has encountered an error and cannot be previewed." on a fresh beta 1 install #58987
Comments
cc @getdave with how much nav block work you've done :D |
Also reported here: https://core.trac.wordpress.org/ticket/60531 |
I was able to reproduce this problem, but it doesn't seem to happen all the time. I was able to reproduce it with InstaWP, but I could not reproduce it in a local environment using wp-env. Below are the steps I was able to reproduce.
03e1475eb6f4ec0930db5f16dbf34897.mp4When log
|
I can reproduce in WordPress 6.5-beta1-57630-src running Twenty Twenty-Four theme and with Gutenberg trunk:
I can't yet replicate when deactivating Gutenburg 😄 Here's the error I'm seeing
As far as I can tell
When the error fires, it's receiving rendered HTML content from getEditedEntityRecord {
"rendered": "<ul class=\"wp-block-page-list\"><li class=\"wp-block-pages-list__item\"><a class=\"wp-block-pages-list__item__link\" href=\"http://localhost:8888/?page_id=2\">Sample Page</a></li></ul>",
"protected": false
} The naive solution might be to check for a string before parsing the block content here: if ( ! _blocks && typeof content === 'string' ) { But since it's only happening for the navigation block, maybe it needs closer 👀 I did notice that the initial content matches the content property from the Whereas the 2024-02-14.13.59.06.mp4 |
My finding also matches what @ramonjd discovered. The error can be consistently reproduced when the Navigation block lacks a Here's a (rough) chain of events:
Update: Found source of regression - https://core.trac.wordpress.org/ticket/43439. |
Thanks for the sleuthing. My understanding:
Changes required:
|
That's correct.
This will be handled by #59058, but it only prevents the error, doesn't fix the issue with missing content.
The |
Yes, we can close this now. |
Having this problem after update to WordPress 6.5 stable. It only appears in the template editor, not in the block editor. With which version was the "function" "Edit your template to edit this block" intruduced? Using twenty-twenty-three and could edit the blocks without the template editor before. |
I'm testing WordPress 6.6-alpha-57778-src running Twenty Twenty-Four theme (gutenberg disabled) and can't reproduce. Would you happen to have a screenshot or more test steps so that folks can confirm? Thank you! |
Just received the update to wordpress 6.5.2 but still the same problem. The error message only appears on all text blocks, other media is still visible. |
This issue related to the navigation block only, but if you're experiencing problems with other blocks it'd be helpful to open a new Github issue and outline the steps to reproduce, e.g., does it happen on all posts, even new ones, or just existing ones. Also be sure to note if you're running any other plugins. Thanks a lot! |
The problem appears on all text blocks. Also on a brand new website without any plugins after I click on "Edit template". Don't know what else to say about this bug. |
To replicate, use this instaWP link to use a site with beta 1: https://app.instawp.io/launch?t=beta-rc&d=v2 Go to Appearance > Editor and see the error. I'm not quite sure what's going on but opening for now after @courtneyr-dev replicated.
The text was updated successfully, but these errors were encountered: