-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 becomes unusable with error "This block has encountered an error and cannot be previewed" #15491
Comments
I have now had this error for the second time during just a few hours. In this case, too, the block contained an embedded weblink. Has something perhaps gone wrong with a Gutenberg / WordPress update? @swissspidy |
I have had this error with every block in several posts since updating to WordPress 5.2. |
"Every block... in several posts" This is starting to look like a major issue connected with WordPress 5.2. It is especially devastating as block content just disappears completely. @swissspidy , could this be prioritised? |
Can you try to open the browser's console and get the JavaScript error from there? |
Can you also share an example of failing post. (Switch to code editor and grab the HTML)? |
I would not like to copy the entire post as the text is quite "politically sensitive" - besides, as the post consists of numerous blocks, wouldn't one have to switch to code editor for every individual block? Or did you mean an example of a block that disappeared? That would be a bit difficult, after the fact. I'll try to find out how to open Safari's console... |
@vesaraiskila I understand that, can't you share a small part of the post's raw HTML containing the block that shows an error? A single one is enough |
I could and would, but the offending blocks' content is inaccessible from the very moment the error message is shown. So I would need to be able to recreate the problem from scratch and copy the raw HTML before the error occurs, and as the error seems to be random, it is impossible to predict which block will produce the error. |
@vesaraiskila you should be able to click the three dots menu (top right) and click "Code editor", you'll see the whole HTML even if the block shows the "This block has encountered an error and cannot be previewed" error. |
Ok, I didn't realise that... the blocks are now deleted but I'll try that the next time. Would you, LeeBalders, be able to help? Something else, too, is strange about WordPress 5.2... When I start to create a new post now and start writing, Classic Paragraph is shown instead of a Gutenberg block. |
@vesaraiskila if the classic block is shown by default, it means you have a plugin or something that bootstraps your post content with some random HTML or text that is not block-based. By default the content is empty, so there's no block at all. |
Again, this is something that WordPress 5.2 has brought. |
I can edit posts in the code editor - it's impossible to edit anything in the visual editor though. For example, this is what I get in the code editor of one of the error blocks:
Exit the code editor and click on the block, and it reverts to "This block has encountered an error and cannot be previewed." This is for each and every block. However, this was affecting 2 out of three of my sites this morning, and right now it seems to be only one of them. |
@LeeBalders Just tried the same content in my testing environment, I have no issues. Opening the browser console and finding the JavaScript error might give us more hints. I suspect it to be related to a plugin conflict or something like that. |
Can you share which plugins are active on the site when errors occur? Do errors occur when creating new content? Could you provide steps to reproduce the error with some test content? Regardless of whether this began to occur in WordPress 5.2, more information is necessary to be able to track down and implement a fix.
@LeeBalders Did you (or possibly another administrator) update your sites' plugins in the time since? And if so, do you recall which ones were updated? It may have been a fix published in an update of one of your plugins. |
They have occurred when creating new posts. (But they might also occur when editing already published posts.
These plugins are installed and active (please copy the list for yourself as I might delete it later): Akismet Anti-Spam |
Just a moment ago a block containing the following caused this error:
|
I just had this error again, and selecting "Code editor" has no effect: nothing is shown in HTML or otherwise. |
Since you have many plugins installed, please try temporarily disabling all plugins and switching to one of the default themes to see if the errors still occur. Also, as requested two times already in this issue: please try to open the browser developer tools and check the console for errors. Take a screenshot of any errors including the expanded information and upload it here. In Safari, you might first need to go to Safari -> Preferences -> Advanced and check the box that says "Show Develop menu in menu bar": After that, on any website you can perform a right click on the site and select "Inspect Element" from the context menu to open the developer tools. From there you can access the console: |
Thanks for commenting, @swissspidy Alas, I don't have a dedicated test environment and cannot simply change to another theme on our website (or disable all plugins). However, I was able to reproduce this bug immediately following the steps described at The creator of that bug report seems to already have pinpointed the cause of the bug. Here is the content of the Java script console for the error in case it helps: |
Thanks all for the info, so it seems that this is a Safari bug that is closed by #15576 |
Describe the bug
After adding a number of blocks, one of them, containing an embedded weblink, became unreadable and unusable with the error message "This block has encountered an error and cannot be previewed."
To reproduce
This error has occurred randomly every now and then during recent months.
Expected behavior
A block does not suddenly just become unusable.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: