diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php
index f5b8b47e5e..4f36a87f0f 100644
--- a/src/wp-includes/blocks.php
+++ b/src/wp-includes/blocks.php
@@ -83,10 +83,10 @@ function register_block_script_handle( $metadata, $field_name ) {
 	}
 
 	$script_handle     = generate_block_asset_handle( $metadata['name'], $field_name );
-	$script_asset_path = realpath(
+	$script_asset_path = wp_normalize_path( realpath(
 		dirname( $metadata['file'] ) . '/' .
 		substr_replace( $script_path, '.asset.php', - strlen( '.js' ) )
-	);
+	) );
 	if ( ! file_exists( $script_asset_path ) ) {
 		_doing_it_wrong(
 			__FUNCTION__,
@@ -100,9 +100,13 @@ function register_block_script_handle( $metadata, $field_name ) {
 		);
 		return false;
 	}
-	$is_core_block       = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], ABSPATH . WPINC );
+	// Path needs to be normalized to work in Windows env.
+	$wpinc_path_norm     = wp_normalize_path( ABSPATH . WPINC );
+	$script_path_norm    = wp_normalize_path( realpath( dirname( $metadata['file'] ) . '/' . $script_path ) );
+	$is_core_block       = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], $wpinc_path_norm );
+
 	$script_uri          = $is_core_block ?
-		includes_url( str_replace( ABSPATH . WPINC, '', realpath( dirname( $metadata['file'] ) . '/' . $script_path ) ) ) :
+		includes_url( str_replace( $wpinc_path_norm, '', $script_path_norm ) ):
 		plugins_url( $script_path, $metadata['file'] );
 	$script_asset        = require $script_asset_path;
 	$script_dependencies = isset( $script_asset['dependencies'] ) ? $script_asset['dependencies'] : array();
@@ -139,7 +143,8 @@ function register_block_style_handle( $metadata, $field_name ) {
 	if ( empty( $metadata[ $field_name ] ) ) {
 		return false;
 	}
-	$is_core_block = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], ABSPATH . WPINC );
+	$wpinc_path_norm = wp_normalize_path( ABSPATH . WPINC );
+	$is_core_block   = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], $wpinc_path_norm );
 	if ( $is_core_block && ! wp_should_load_separate_core_block_assets() ) {
 		return false;
 	}
@@ -232,7 +237,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
 	if ( ! is_array( $metadata ) || empty( $metadata['name'] ) ) {
 		return false;
 	}
-	$metadata['file'] = $metadata_file;
+	$metadata['file'] = wp_normalize_path( $metadata_file );
 
 	/**
 	 * Filters the metadata provided for registering a block type.
