TypeError: f is undefined – Need ‘editor’ JS dependency
-
I was getting the JS error below when trying to change between the Visual/HTML tabs.
TypeError: f is undefined
I’ve narrowed down the problem to being the fact that I have the
SCRIPT_DEBUGPHP constant set (in my dev environment) which WordPress uses as a queue to disable concatenation of admin scripts. This was causing “hesh.min.js” to be loaded before “wp-admin/js/editor.js” which contains a dependency of your plugin (eg:window.switchEditors).To fix this please add ‘editor’ as a dependency of your “hesh.min.js” script. EG
wp_register_script( 'heshjs', HESH_LIBS.'hesh.min.js', array('codemirror', 'editor'), $ver, true );Thanks!
The topic ‘TypeError: f is undefined – Need ‘editor’ JS dependency’ is closed to new replies.