diff --git a/packages/customize-widgets/src/index.js b/packages/customize-widgets/src/index.js index bf3b8eef0c8622..e578b491adbb90 100644 --- a/packages/customize-widgets/src/index.js +++ b/packages/customize-widgets/src/index.js @@ -11,6 +11,7 @@ import { registerLegacyWidgetBlock, registerLegacyWidgetVariations, } from '@wordpress/widgets'; +import { setFreeformContentHandlerName } from '@wordpress/blocks'; /** * Internal dependencies @@ -49,6 +50,12 @@ export function initialize( editorName, blockEditorSettings ) { } registerLegacyWidgetVariations( blockEditorSettings ); + // As we are unregistering `core/freeform` to avoid the Classic block, we must + // replace it with something as the default freeform content handler. Failure to + // do this will result in errors in the default block parser. + // see: https://github.com/WordPress/gutenberg/issues/33097 + setFreeformContentHandlerName( 'core/html' ); + const SidebarControl = getSidebarControl( blockEditorSettings ); wp.customize.sectionConstructor.sidebar = getSidebarSection(); diff --git a/packages/edit-widgets/src/index.js b/packages/edit-widgets/src/index.js index 7ed910113e7e8f..7527529dbb4edd 100644 --- a/packages/edit-widgets/src/index.js +++ b/packages/edit-widgets/src/index.js @@ -4,6 +4,7 @@ import { registerBlockType, unstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase + setFreeformContentHandlerName, } from '@wordpress/blocks'; import { render } from '@wordpress/element'; import { @@ -63,6 +64,11 @@ export function initialize( id, settings ) { settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) => fetchLinkSuggestions( search, searchOptions, settings ); + // As we are unregistering `core/freeform` to avoid the Classic block, we must + // replace it with something as the default freeform content handler. Failure to + // do this will result in errors in the default block parser. + // see: https://github.com/WordPress/gutenberg/issues/33097 + setFreeformContentHandlerName( 'core/html' ); render( , document.getElementById( id )