Skip to content
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

Closed
vesaraiskila opened this issue May 8, 2019 · 21 comments
Labels
Needs Testing Needs further testing to be confirmed. [Status] Needs More Info Follow-up required in order to be actionable.

Comments

@vesaraiskila
Copy link

vesaraiskila commented May 8, 2019

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):

  • OS: Mac OS Mojave version 10.14.4
  • Browser: Safari
  • Safari version: 12.1

Additional context

  • WordPress version: 5.2 (with the included Gutenberg version)
@vesaraiskila
Copy link
Author

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

@LeeBalders
Copy link

I have had this error with every block in several posts since updating to WordPress 5.2.

@vesaraiskila
Copy link
Author

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?

@youknowriad
Copy link
Contributor

Can you try to open the browser's console and get the JavaScript error from there?

@youknowriad youknowriad added [Status] Needs More Info Follow-up required in order to be actionable. Needs Testing Needs further testing to be confirmed. labels May 8, 2019
@youknowriad
Copy link
Contributor

Can you also share an example of failing post. (Switch to code editor and grab the HTML)?

@vesaraiskila
Copy link
Author

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...

@youknowriad
Copy link
Contributor

@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

@vesaraiskila
Copy link
Author

vesaraiskila commented May 8, 2019

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.

@youknowriad
Copy link
Contributor

@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.

@vesaraiskila
Copy link
Author

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.

@youknowriad
Copy link
Contributor

@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.

@vesaraiskila
Copy link
Author

@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.

@LeeBalders
Copy link

LeeBalders commented May 8, 2019

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:

<!-- wp:paragraph -->
<p>April has been traditionally our big-spend month since it's been the month when our car insurance is renewed, and our vehicle tax falls in the same month now as well.</p>
<!-- /wp:paragraph -->

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.

@youknowriad
Copy link
Contributor

@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.

@aduth
Copy link
Member

aduth commented May 8, 2019

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.

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 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.

@vesaraiskila
Copy link
Author

Do errors occur when creating new content? Could you provide steps to reproduce the error with some test content?

They have occurred when creating new posts. (But they might also occur when editing already published posts.

Can you share which plugins are active on the site when errors occur?

These plugins are installed and active (please copy the list for yourself as I might delete it later):

Akismet Anti-Spam
Coming Soon Page & Maintenance Mode by SeedProd
Comment E-Mail Verification
Contact Form 7
Easy Panorama
Edit Author Slug
Featured Image Caption
Footnotes
Google Analytics Counter Tracker
Google Analytics Dashboard for WP (GADWP)
Jetpack by WordPress.com
Jetpack Subscription Form
Categories to Keywords Converter
Members
Menu Exporter
Perfect Pullquotes
Social Media Feather
Sucuri Security
tagDiv Composer
tagDiv Mobile Theme
tadDiv Social Counter
TinyMCE Advanced
Ultimate Coming Soon Page
Uudelleenohjaus (Redirection)
Very Simple Knowledge Base
Widget Importer & Exporter
WordPress-tuontiohjelma
WP Like Button
WP-UserOnline
WPBakery Visual Composer
Yoast SEO

@vesaraiskila
Copy link
Author

vesaraiskila commented May 10, 2019

Just a moment ago a block containing the following caused this error:

<p>Kreikan talous, jota pelastettiin Troikan (IMF, EU, EKP) toimesta moneen otteeseen, on pelastustoimien seurauksena supistunut noin 25 prosenttia.</p>

@vesaraiskila
Copy link
Author

@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.

I just had this error again, and selecting "Code editor" has no effect: nothing is shown in HTML or otherwise.

@swissspidy
Copy link
Member

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":

Screenshot 2019-05-10 at 08 11 32

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:

Screenshot 2019-05-10 at 08 13 59

@vesaraiskila
Copy link
Author

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

#15576

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:

image

@youknowriad
Copy link
Contributor

Thanks all for the info, so it seems that this is a Safari bug that is closed by #15576
Let's open other issues if we find other ways to reproduce the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed. [Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

No branches or pull requests

5 participants