Flush and sleep in skins/Vector.php to give time for RL to finish before the main document finishes loading
With $wgResourceLoaderExperimentalAsyncLoading enabled, modules are loaded from the <head> rather than from the end of the <body>. This causes the modules to be loaded simultaneously with the main HTML, and under certain conditions, module execution may occur before the #mw-panel element appears in the DOM.
ext.vector.collapsibleNav in particular does not register a $(document).ready() callback, it just tries to modify the DOM at the file level of the module. No errors are logged, $( '#mw-panel' ) just returns an empty list and the styling is not applied. Other modules may have similar issues with $wgResourceLoaderExperimentalAsyncLoading.
Bug 34450 may possibly be related but there were a lot of issues mixed in there without any reproduction procedure so I decided to file a new bug.
Whether or not you see the issue depends on the browser, page length, network speed and cache timing details, but it's possible to reliably reproduce it by slowing down page delivery with the attached flush/sleep patch, and setting MW_NO_OUTPUT_BUFFER in LocalSettings.php:
define( 'MW_NO_OUTPUT_BUFFER', 1 );
Using that method, I can reproduce it every time in Firefox or Chrome.
Version: 1.20.x
Severity: normal
Attached: