Having buried myself in google looking for resolutions to this bug, and having found none, along with the entirety of this morning debugging trying to work out the problem I am hitting a dead end!
The bug appeared immediately after upgrading to 2.2 (subsequent upgrades to 2.2.1 and 2.2.2 have not resolved the issue), while it worked without issue on 2.1.x
The bug presents itself like below:
require.js:1895 GET static/version1518612075/frontend/ar/<vendor>/en_GB/jquery/ui.js net::ERR_ABORTED Uncaught Error: Script error for: jquery/ui http://requirejs.org/docs/errors.html#scripterror at makeError (require.js:166) at HTMLScriptElement.onScriptError (require.js:1681)
With the odd smattering of load timeout caused by the same reason.
So interestingly before getting further into depth with this, it works absolutely FLAWLESSLY if left to self-generate the files in developer mode. However, the instant it is deployed in production via static-content:deploy, all of these issues start appearing.
Anyway, in particular the issue is caused by requirejs looking at a completely wrong path, even on stock magento defined modules:
It, in fact, should be looking for either of the following:
All of the requirejs-config.js path/maps reference the above (minus .js ofcourse). It is almost like it is breaking down the dependency definition and instead using that to generate a path.
Not the only file that is affected, have Aheadworks, Amasty, other core Magento modules, across the board issue.
It's not the static asset issue with nginx that was fixed in 2.1.x, using the correct nginx config for that.
Wondering if any else has come across this?