Grazia has this issue with their mediaelement JS, where localized data is not output during JS concat.
The symptom is that their video embeds have black bars.
It's possible this issue affects code elsewhere with a similar pattern, which is when a group of scripts is enqueued without a JS url, and localized data is also set using the same group handle.
Here is an example pattern that will reproduce this issue, in this case from WP core wp-includes/script-loader.php:
$scripts->add( 'mediaelement', false, array( 'jquery', 'mediaelement-core', 'mediaelement-migrate' ), '4.2.6-78496d1' );
...
did_action( 'init' ) && $scripts->localize(
'mediaelement', '_wpmejsSettings',
/**
* Filters the MediaElement configuration settings.
*
* @since 4.4.0
*
* @param array $mejs_settings MediaElement settings array.
*/
apply_filters( 'mejs_settings', $mejs_settings )
);
The mediaelement group contains no src attribute but does contain the extra / data attribute
(
[handle] => mediaelement
[src] =>
[deps] => Array(
[0] => jquery
[1] => mediaelement-core
[2] => mediaelement-migrate
)
[ver] => 4.2.6-78496d1
[args] =>
[extra] => Array(
[data] => var _wpmejsSettings = {"pluginPath":"\/wp-includes\/js\/mediaelement\/","classPrefix":"mejs-","stretching":"responsive"};
)
)
At line 52 of jsconcat, however, the handle is skipped because it has an empty src
50: if ( ! $this->registered[$handle]->src ) { // Defines a group.
51: $this->done[] = $handle;
52: continue;
53: }
As a result, the settings var is missing, and the media element is not "responsive".
I'll fix this with a pull request shortly, adding after line 50:
$this->print_extra_script( $handle );
I've tested it on Grazia sandboxed and it results in the correct settings var being set.
Props to @mdbitz for narrowing the issue down to the JS concat.