JavaScript error in Widgets editor: getCurrentPostType is undefined
-
I am encountering a JavaScript error from Easy Accordion when opening Appearance > Widgets in the WordPress block-based Widgets editor. WordPress displays the following message: “The ‘speap-saved-template-sidebar’ plugin has encountered an error and cannot be rendered.” The browser console reports: TypeError: Cannot read properties of undefined (reading 'getCurrentPostType') at ea-blocks.js?ver=3.1.4 at data.min.js at render (ea-blocks.js?ver=3.1.4) It appears that ea-blocks.js tries to access the getCurrentPostType selector in the Widgets editor, where the relevant post editor data store is not available. Steps to reproduce: 1. Activate Easy Accordion. 2. Open Appearance > Widgets. 3. Use the block-based Widgets editor. 4. The “speap-saved-template-sidebar” component fails to render. 5. The getCurrentPostType JavaScript error appears in the browser console. Easy Accordion version: 3.1.4 As a temporary workaround, I can disable the block-based Widgets editor with: add_filter( 'use_widgets_block_editor', '__return_false' ); However, I would prefer to continue using the block Widgets editor. Could you please update the editor script so that it checks whether the required editor store and getCurrentPostType selector exist before calling them? Thank you.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.