Hi Mehadi,
As a quick follow-up, the error is related to the theme scripts.php file and the enqueuing of the spectra scripts. If I remove this function, the error with the native blocks is removed. Obviously, this isn’t the complete solution, but I thought it might be helpful to point this in the right direction. I can see that you watched part of the video I provided, if you need any further information please let me know.
Best Regards, Tony
/**
* Enqueue Editor Scripts.
*
* @since 0.0.1
*
* @return void
*/
function enqueue_editor_scripts(): void {
if ( false === apply_filters( 'swt_enqueue_editor_scripts', true ) ) {
return;
}
$js = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? get_uri() . 'build/' : get_uri() . 'assets/js/';
$asset = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? require SWT_DIR . 'build/editor.asset.php' : require SWT_DIR . 'assets/js/editor.asset.php';
$deps = $asset['dependencies'];
wp_register_script( SWT_SLUG . '-editor', $js . 'editor.js', $deps, SWT_VER, true );
wp_enqueue_script( SWT_SLUG . '-editor' );
wp_localize_script(
SWT_SLUG . '-editor',
SWT_LOC,
localize_editor_script()
);
}
add_action( 'enqueue_block_editor_assets', SWT_NS . 'enqueue_editor_scripts' );