When trying to upload any file to Commons which already exists there, the user sees a warning like this:
Strangely, the file-exists-duplicate message is escaped here even though the JavaScript code is as follows:
this.setError( code, mw.message( 'file-exists-duplicate', allDuplicates.length ).parse(), $extra );
In the console, the following warning is thrown:
VM96:90 mediawiki.jqueryMsg: file-exists-duplicate: Cannot read property 'hasAlreadyBeenUsedAsAReplacement' of undefined