Sometimes (50% of cases) no js is loading on commons, especially when viewing file description pages.
https://commons.wikimedia.org/wiki/Commons:Help_desk#Random_missing_HotCat_links
| Steinsplitter | |
| Dec 10 2016, 2:46 PM |
| F5030405: console | |
| Dec 11 2016, 12:27 AM |
Sometimes (50% of cases) no js is loading on commons, especially when viewing file description pages.
https://commons.wikimedia.org/wiki/Commons:Help_desk#Random_missing_HotCat_links
[ - SRE; + WMF-General-or-Unknown ]
When this happens, can you please check in your web browser's developer tools ('console' and/or 'network') if there are any related errors?. For more information please see:
One thing that stands out is:
Exception in module-execute in module ext.gadget.CropTool: load.php:176:576
TypeError: mw.Uri is not a constructor TypeError: mw.Uri is not a constructor
Stack trace:
Thanks! After enabling CropTool on https://commons.wikimedia.org/wiki/Special:Preferences#mw-prefsection-gadgets and going to https://commons.wikimedia.org/wiki/File:Pillangós_-_panoramio.jpg?debug=true (note the debug=true) I still cannot reproduce. :(
Try to load the page a few times, and you won't see gadgets loading.
I see nothing special (such as timeouts or huge coding errors) in the console.
I have more luck reproducing it with "fresh" files. Refreshing the page will fix it, and then it stays fixed when refreshed several more times. There's nothing special about that particular file I posted, it's quite easy for me to reproduce on a random file. Adding ?debug=true seems to fix it too.
The CropTool gadget was definitely missing a dependency. Fixed: https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadgets-definition&diff=225909613&oldid=211657054
The issue was caused by this edit to the gadget: https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-CropTool.js&diff=203599240&oldid=118183121 (this was a while ago, I don't know why it only started causing problems now. Something else must have been loading mediawiki.Uri and now it doesn't need it, or the load order has changed.)
I'll follow up at the help desk too, that user might be having a separate problem.
@Ghouston: Your console log was very useful, thanks. Out of curiosity, it seems to also have a ton of other "errors" which really look like some sort of debugging warnings (e.g. "SyntaxError: test for equality (==) mistyped as assignment (=)?") – how do you even enable that?
Thanks, that fixes it for me. I guess the load order was changing between the working and non-working versions, maybe depending on whether the files were cached.
I compared my console output with what I get in a new Firefox profile. Firstly I had CSS warnings turned on. But the JS messages come from setting javascript.options.strict to true in about:config. I have no idea when or why I did that, it was probably years ago.