For anyone who comes across this and pulls their hair a little, @ dale3h's answer was the solution for me.
If you have a function in your functions.php which script_loader_tag script_loader_tag and does not always return the corresponding parts of the original markup of the tag, or there is some kind of error in it, this may lead to the fact that some scripts will not be loaded, because Scripts for The output to the page is first run through this filter.
Something I did to avoid this is whitelist script descriptors depending on what additional attributes I want to give them so that the work can be performed conditionally (leaving all other scripts unchanged):
// Manage extra attibutes for enqueued scripts function foo_script_extras( $tag, $handle, $src ){ $whitelist = array( 'js-font-awesome-core' => array( 'sri' => 'sha384-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'defer' => true ), 'js-font-awesome-light' => array( 'sri' => 'sha384-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'defer' => true ), 'js-popper' => array( 'sri' => 'sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ' ), 'js-bootstrap' => array( 'sri' => 'sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm' ), 'js-gtag' => array( 'async' => true ) ); // Construct the script if we want to give it extra attributes if( array_key_exists( $handle, $whitelist ) ){ // Extra markup $extra = ''; $mods = $whitelist[$handle]; // Check for SRI if( array_key_exists( 'sri', $mods ) ){ $extra .= ' integrity="' . $mods['sri'] . '" crossorigin="anonymous"'; } // Check for deferral if( array_key_exists( 'defer', $mods ) ){ $extra .= ' defer'; } // Check for async if( array_key_exists( 'async', $mods ) ){ $extra .= ' async'; } // Reutrn full script tag return '<script src="' . $src . '"' . $extra . '"></script>'; }else{ // Return the tag as-is otherwise to avoid breaking it return $tag; } } add_filter( 'script_loader_tag', 'foo_script_extras', 10, 3 );
This is not a very general solution in terms of checking which attributes to add to the white list descriptors, and I would use something like "for each attribute of the white list descriptor, add the key if it is logical and true, otherwise add this value "but SRI needs two attributes (integrity and cross origin), so I left it now.
In addition, if you do not see /wp-includes/js/tinymce/ somewhere in the layout of your page (similar to what @Mar said, but the exact script name may change in different versions), then this script does not load!