Gutenberg style broken on 6.4 update

I have updated most of my sites to 6.4, which were built on sage 9. As soon as that happened, you’ll get the styles in the editor for all the pages to appear like the attached:

Switching to a different theme, everything looks ok.

The console errror i’m getting is this:

/dist/styles/main.css?wp-mce-49110-20201110 net::ERR_ABORTED 404 (Not Found)

any ideas on how to fix?

How are you adding the editor styles?
In latest Sage 9.x the following is used:

1 Like

This could be a conflict with Soil’s relative URLs feature

If you’ve got that enabled, try disabling it

Hey @ben and @strarsis thank you for your reply. Unfortunately disabling Soil did not change anything - as well, the code in my setup file looks exactly how you posted it.

I should mention that this only happens for Gutenberg pages, I have a few plugins that still utilize the tinymce editor, and those match my themes styles fine.

I have 5-10 websites that are all doing this.

Thanks!

Hi @bonlando

I also encountered this problem and here’s my solution. I added this to my setup.php

/**
 * Register the theme assets with the block editor.
 *
 * @return void
 */
add_action('enqueue_block_editor_assets', function () {

  wp_enqueue_style('sage/editor.css', asset_path('styles/editor.css'), false, null);
}, 100);

Thanks, but this actually didn’t work for me. It seems there should be an editor.css stylesheet to reference, but there isn’t one in my dist file at all…

A workaround, just remove theme.json in your plugin root (sage)

See https://github.com/roots/sage/issues/3160#issuecomment-1854181662 for a solution

1 Like