wp_enqueue_script silently fails
I created a plugin which uses bootstrap datetimepicker. So i load corresponding js setting dependancies like this:
wp_enqueue_script('medapp-datetimepicker-js', $medapp_boot_timepicker_js, array(
'jquery',
'jquery-ui',
'moment',
'medapp-twitter-bootstrap-js'
));
wp_enqueue_script('medapp-frontend-js', $medapp_script_js, array(
'jquery',
// 'medapp-datetimepicker-js',
),'',false);
If the line commented is on, of course in my js file i can't access datetimepicker and i have the following error when i try to instanciate the datetimepicker:
TypeError: jQuery(...).datetimepicker is not a function
So i uncomment the commented line, and then load of scripts silently fails (it seems nothing is loaded after the second wp_enqueue_script, but without any console error), and the page does not display entirely.
I know datetimepicker script is loaded correctly as i output all regegistered handlers like this:
function medapp_inspect_scripts() {
global $wp_scripts;
foreach( $wp_scripts-queue as $handle ) {
MEDAPI::getLogger("MEDAPP")-debug( $handle );
}
}
which correctly outputs the datetimepicker handler.
Any idea how i could debug this please ?
Topic wp-dependencies wp-enqueue-script Wordpress
Category Web