Skip to content

Commit

Permalink
Blocks: provide nice error message for workaround in dev env (#39602)
Browse files Browse the repository at this point in the history
* Provide nice error message for workaround

* typos will be the dealth of me
  • Loading branch information
kraftbj authored Oct 5, 2024
1 parent d6d3ba7 commit 8a5b2e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/plugins/jetpack/changelog/add-nice-fatal-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Just adding a nicer error message that would only display in dev environments.


4 changes: 4 additions & 0 deletions projects/plugins/jetpack/class.jetpack-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ public static function enqueue_block_editor_assets() {
// wp-edit-post but wp-edit-post's styles break the Widget Editor and
// Site Editor) until a real fix gets unblocked.
// @todo Remove this once #20357 is properly fixed.
$wp_styles_fix = wp_styles()->query( 'jetpack-blocks-editor', 'registered' );
if ( empty( $wp_styles_fix ) ) {
wp_die( 'Your installation of Jetpack is incomplete. Please run "jetpack build plugins/jetpack" in your dev env.' );
}
wp_styles()->query( 'jetpack-blocks-editor', 'registered' )->deps = array();

Assets::enqueue_script( 'jetpack-blocks-editor' );
Expand Down

0 comments on commit 8a5b2e7

Please sign in to comment.