WordPress blocks not working on WP version 6.4 (RC)

Hi, I’ve done some quick testing with a vanilla block plugin generated by Pinegrow in the latest WordPress release candidate (version 6.4). I wanted to check if it would work, but for my surprise, it simply doesn’t show up in the block inserter. Only an error message appears:

“Your site doesn’t include support for the “pinegrow-block/pinegrow-block” block. You can leave this block intact or remove it entirely.”

Here’s a video with the test.

The issue is that pg-blocks-controls.js uses lodash, but WordPress now removes it.

I could make the block appear by adding lodash as a dependency in the wp_register_script function for the pg-blocks-controls.js file in wp_pg_blocks_helpers.php.

But probably this isn’t a proper solution, according to this comment from the Gutenberg repo.

wp_register_script('pg-blocks-controls',
                    $base_url . 'blocks/pg-blocks-controls.js',
                    array('wp-blocks', 'wp-block-editor', 'wp-server-side-render', 'wp-media-utils', 'wp-data', 'wp-element', 'lodash'), $reg_args[ 'version' ]);

I thought you would like to know. WP 6.4 is coming next November, so there’s time for a fix.

7 Likes

@marc_io thanks for the report! We’ll publish an update for this next week.

3 Likes

@marc_io, you are a true hero! I’m not happy about the way WP is quietly deprecating things and I’m definitely not happy about having to re-export all my projects but I’m thankful that you found this and brought it to Pinegrow’s attention.

2 Likes

@adamslowe Thanks, we’re all in the same boat here. It’s been a lot of work to keep up with these constant changes, it’s almost a full time job, really. Let’s hope things start to settle a bit more, and kudos for the Pinegrow team to stay in this unstable game.

2 Likes

@marc_io @adamslowe we will have two ways to fix this:

  1. By re-exporting projects with the next release of Pinegrow
  2. By installing a simple WordPress plugin that will insure older blocks are compatible with WordPress 6.4. The plugin is available now, please try it if you can: Release 1.0.0 · Pinegrow/LoadLodashForPinegrowBlocks · GitHub

The plugin adds lodash as a dependency for the pg-blocks-controls script.

The option 2 is easy and quick, and gives you time to reexport existing projects without hurry.

Options 1 and 2 can be used together on a single site.

7 Likes

Thanks for providing the plugin solution so quickly, @matjaz. I’ve tested it with WordPress version 4.6-RC2, and it works fine.

5 Likes