Site logo

Archived topic

BUG in Gutenberg: This block has encountered an error and cannot be previewed

7 replies · Started by ernestw on November 10, 2022

Viewing posts 1–8 of 8

Hello,

I am experiencing this bug in the Gutenberg editor: sometimes when I click on simple paragraphs (with no customization, just standard p blocks in WP) I get this message "This block has encountered an error and cannot be previewed". The frontend is ok, and when I reload the editor the error goes away. Anyway, if I click again, I get the same message (randomly, but often).

This is happening in 2 different websites I own, with the latest versions of WP (6.1) and GP pro.

I have cleared the cache, disabled ALL the plugins and kept only GP to test, and created a new post (only paragraphs): the problem persists! When I try a different theme (twenty twenty three) everything works fine, even with all plugins activated...

I am really lost...

Thanks!

I have done a lot of testing, and the problem actually seems to be GP. I have created a completely new WP site (local) and I still have this error.

Steps to reproduce:

create a clean WP install
install gp theme (not PRO)
in the customizer set "Container Width" to 2000px
create a post with just some paragraphs and publish it
go to the posts list > edit post
Click on the paragraphs (try multiple times)

Error: "This block has encountered an error and cannot be previewed"

If in the editor preferences I disable "Use theme styles", everything works.

Hi there,

so the issue only occurs if you try to edit an existing post ?

Can you Right Click > Inspect to open the browser developers tools whilst in the editor.
When the Error: “This block has encountered an error and cannot be previewed” appears, what errors do you see in the Console tab of the developers tools ?

Hi David, thanks for your reply. Yes, it happens in an already published post.
Anyway, I have done some more testing with new local websites, and the Astra theme does it too (when the container is set to full width). I submitted the bug in the Gutenberg Github.

Here is the message:

TypeError: Range.setStart: Argument 1 is not an object.
c http://bug-test.local/wp-includes/js/dist/dom.min.js?ver=133a042fbbef48f38107:2
I http://bug-test.local/wp-includes/js/dist/dom.min.js?ver=133a042fbbef48f38107:2
U http://bug-test.local/wp-includes/js/dist/dom.min.js?ver=133a042fbbef48f38107:2
q http://bug-test.local/wp-includes/js/dist/dom.min.js?ver=133a042fbbef48f38107:2
k http://bug-test.local/wp-includes/js/dist/dom.min.js?ver=133a042fbbef48f38107:2
pu http://bug-test.local/wp-includes/js/dist/block-editor.min.js?ver=d39738cb7c1202964677:26
$r http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
unstable_runWithPriority http://bug-test.local/wp-includes/js/dist/vendor/react.min.js?ver=17.0.1:9
xn http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Qr http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Pr http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Nn http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
unstable_runWithPriority http://bug-test.local/wp-includes/js/dist/vendor/react.min.js?ver=17.0.1:9
xn http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Nn http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
_n http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
ua http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
pe http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Ye http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Ke http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
qe http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
qe http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
pl http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
_reactRootContainer http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
ml http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
render http://bug-test.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:9
Po http://bug-test.local/wp-includes/js/dist/edit-post.min.js?ver=2baffbeec6cbe5171dee:7
_wpLoadBlockEditor http://bug-test.local/wp-admin/post.php?post=5&action=edit:1829
n http://bug-test.local/wp-includes/js/dist/dom-ready.min.js?ver=392bdd43726760d1f3ca:2
_wpLoadBlockEditor http://bug-test.local/wp-admin/post.php?post=5&action=edit:1828
<anonymous> http://bug-test.local/wp-admin/post.php?post=5&action=edit:1827
<anonymous> http://bug-test.local/wp-admin/post.php?post=5&action=edit:1832
react-dom.min.js:9:64017

Any particular browser you using ?

Firefox (snap) on Ubuntu Linux.
I had no idea it could be a browser problem. In Chrome seems to work fine. Very strange...

Thanks for your help!

Yeah, this Range.setStart is a browser API call, which lead me to that thought.
It could be that particular build or a browser extension getting in the way.

Glad to be of some help

Thanks David, very kind!

This archived topic is closed to new replies.