Johannes Reiter
Johannes Reiter

Reputation: 50

ACF Block states "This block has encountered an error and cannot be previewed." when switching between edit and preview mode

After updating to WordPress 6.7, if I switch between the "edit" and the "preview" mode in the block-editor, the block breaks stateing "This block has encountered an error and cannot be previewed."

This happens to all blocks.

I'm getting a JS error "Uncaught TypeError: this.tabs is undefined" and "The above error occurred in the component:"

Upvotes: 0

Views: 296

Answers (1)

Johannes Reiter
Johannes Reiter

Reputation: 50

As of WordPress 6.7 SCRIPT_DEBUG, true enables the React StrictMode. This causes an js-error which breaks the block(s).

Just set define('SCRIPT_DEBUG', false); in your wp-config.php as a temporary workaround. As mentiond here the ACF-Team should work on a permanent fix.

UPDATE: As of ACF Version 6.3.12 this bug is fixed and blocks work with React strict mode. See the Changelog for Details

Upvotes: 1

Related Questions