Re-enable the old widget editor by disabling the new widget editor, delete the existing widgets, and re-enable the new widget editor.
Add this code to your theme’s functions.php file to disable the old widget editor:
// Disables the block editor from managing widgets in the Gutenberg plugin.
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
// Disables the block editor from managing widgets.
add_filter( 'use_widgets_block_editor', '__return_false' );
There was an error. Cannot read properties of undefined (reading ‘map’)
Alternatively, use the Classic Widgets plugin to re-enable the old widget editor.
Block-based Widgets Editor in WordPress 5.8
If you click on ‘Appearance’ and then ‘widgets’ in the sub-menu you’ll get the error message. However, if you select ‘Appearance’ and then ‘Customize’ There is a roundabout: click ‘Customize’ instead of ‘Appearance’ in the Dashboard. The Customization side panel opens up and you can modify the widgets in that panel without generating an error message.