Page MenuHomeMiraheze

Mobile.css / Mobile.js not loading since MW 1.35 upgrade
Open, NormalPublic

Description

Wiki URL: https://spcodex.wiki/wiki/Main_Page?useformat=mobile

Aside from a few expected Vector deprecations, all seems fine following T6229, except for MobileFrontend. At least on spcodex.wiki (db name solarawiki), MediaWiki:Mobile.css and MediaWiki:Mobile.js are not loading at all. They still should, according to mw:Extension:MobileFrontend (and also I see WMF enwiki still has a lot of in-use Mobile.css styles).

I tried making changes to the pages, thinking maybe that would trigger it to re-fetch or whatever, but no dice.

Related Objects

Event Timeline

Perhaps not because Mobile.js is also not loading and that is not behind this config flag. Besides, my understanding is that flag also blocks the rendering until everything in Mobile.css is loaded, which can be quite bad (depending on how much is in there).

I'll keep investigating.

I'm told https://phabricator.wikimedia.org/T265566 could be the issue, but if that were the case Common.css and Minerva.css should load in mobile, which it isn't for me. E.g. https://spcodex.wiki/wiki/Main_Page?useskin=minerva and https://spcodex.wiki/wiki/Main_Page?useskin=minerva&useformat=mobile do not match up as I expect they would if that were the case.

However, mw.loader.getState('mobile.site') is "registered", and mw.loader.getState('site') is "ready" which is suspect.

Universal_Omega claimed this task.

Seems to be fixed? Works for me. On the wiki you listed, the links appears in the Minerva menu, which are added through Mobile.js.

RhinosF1 removed Universal_Omega as the assignee of this task.

That doesn't make sense why it would work on some wikis but not others. The css listed on that wiki, is small, are sure that is the correct Minerva selectors? It seems to me to be incorrect CSS no real issues with it besides CSS.

It's actually loading Minerva.js, which adds the links (a workaround I'm using since I first created this task). It does not load Mobile.js or Mobile.css, and more strangely it doesn't seem to load Minerva.css either. Something is definitely awry.

I was working with Jdlrobson who's on the Web team at WMF to try and figure it out. Here's some excerpts from our conversation that may be helpful in debugging:

20:55:51 <Jdlrobson> provided MobileFrontend and core are in sync I'm not sure why they wouldn't load.
20:56:33 <Jdlrobson> mw.loader.getState('mobile.site') is registered thats weird
20:56:41 <Jdlrobson> mw.loader.getState('site') is ready
...
21:19:35 <Jdlrobson> It's definitely loading MediaWiki:Common.js
21:19:40 <Jdlrobson> I can see it in the network tab
...
19:20:15 <Jdlrobson> https://spcodex.wiki/w/load.php?lang=en&modules=site&skin=minerva&version=t3z6r&debug=true&only=scripts
...
19:21:08 <Jdlrobson> it's possible something else is happening https://spcodex.wiki/w/load.php?lang=en&modules=site.styles&skin=minerva&version=t3z6r&debug=true&only=styles
...
19:25:20 <Jdlrobson> If you can debug it might be worth looking at what's going on inside ResourceLoaderSiteStylesModulePages
19:25:48 <Jdlrobson> https://gerrit.wikimedia.org/g/mediawiki/extensions/MobileFrontend/+/68c94b893538a73e2fc5a72359aa627f42208507/includes/MobileFrontendHooks.php#405
19:25:57 <Jdlrobson> that's what's either happening or not happening behind the scenes
19:26:29 <Jdlrobson> (for cSS)
19:26:30 <Jdlrobson> for JS: https://gerrit.wikimedia.org/g/mediawiki/extensions/MobileFrontend/+/68c94b893538a73e2fc5a72359aa627f42208507/includes/MobileFrontendHooks.php#429
19:28:13 <Jdlrobson> so in theory either it behaves exactly like desktop OR adds MediaWiki:Mobile.css / MediaWiki:Mobile.js. It looks like MediaWiki:Minerva.css is only loaded in desktop mode.
19:28:29 <Jdlrobson> it's unset here for mobile > https://gerrit.wikimedia.org/g/mediawiki/extensions/MobileFrontend/+/68c94b893538a73e2fc5a72359aa627f42208507/includes/MobileFrontendHooks.php#415
19:30:55 <Jdlrobson> the fact that Common.css but not Minerva.css is showing up is super weird
19:31:05 <Jdlrobson> suggests its not varying on skin
19:31:21 <Jdlrobson> it shows up in https://spcodex.wiki/w/load.php?lang=en&modules=site.styles&debug=true&only=styles&skin=minerva
19:34:45 <Jdlrobson> It does feel like something between core and MobileFrontend and maybe Minerva are out of sync
...
19:37:24 <Jdlrobson> i dont know how else site can't get added
19:37:44 <Jdlrobson> Minerva used to unset it but we changed a few things around so that MobileFrontend just modified a hook and core took care of the rest
19:38:10 <Jdlrobson> My guess would be I4508762629333c96dc6b11f6c0f63b675b367209 is not present in Minerva
...
19:38:48 <Jdlrobson> I say this because https://spcodex.wiki/w/index.php?title=Main_Page&mobileaction=toggle_view_desktop&useskin=vector works fine
19:38:53 <Jdlrobson> (that's Vector running in mobile mode)
19:38:58 <Jdlrobson> I see requests there for site.
...
19:42:03 <Jdlrobson> https://phabricator.wikimedia.org/T237050
19:42:23 <Jdlrobson> Only core and MobileFrontend it reckons
19:43:43 <Jdlrobson> I wonder if this needs to be backported > https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/637048
19:45:01 <Jdlrobson> well i think somethings amiss here I'm just not sure what
19:45:08 <Jdlrobson> it would be helpful to see the state of SkinMinerva.php on that wiki
19:45:18 <Jdlrobson> to identify any problematic code there.
19:45:36 <Jdlrobson> if anything is tinkering with $modules['core'
19:45:44 <Jdlrobson> in the getDefaultModules function that would do it
19:46:52 <musikanimal> their Minerva is at bb52d27 which is only one (unrelated) commit behind the REL1_35 branch
19:47:01 <musikanimal> so this is their version of SkinMinerva.php https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/bb52d27c16af22a1af1b3553c1e2d3575966c12e/includes/Skins/SkinMinerva.php
19:49:05 <Jdlrobson> hmm nothing looks suspicious there. Nothing is unsetting the site module
19:49:18 <Jdlrobson> is anything using the SkinMinervaDefaultModules hook?
19:50:01 <Jdlrobson> you'll need to do some debugging inside the Skin::getDefaultModules function to get to the bottom of this
19:50:08 <Jdlrobson> find out what it returns

You can do a hacky workaround by doing something like this in Common.js (untested):

if(mw.config.get('skin') === 'minerva') {
    mw.loader.load('//spcodex.wiki/wiki/MediaWiki:Mobile.js?action=raw&ctype=text/javascript')
}

but I instead used Minerva.js. I'm going to try loading the CSS using the above hack, but I really hate to do that as it will bypass ResourceLoader.

That doesn't make sense why it would work on some wikis but not others. The css listed on that wiki, is small, are sure that is the correct Minerva selectors? It seems to me to be incorrect CSS no real issues with it besides CSS.

See the MediaWiki discord #skinning channel

That doesn't make sense why it would work on some wikis but not others. The css listed on that wiki, is small, are sure that is the correct Minerva selectors? It seems to me to be incorrect CSS no real issues with it besides CSS.

See the MediaWiki discord #skinning channel

I saw. I apologize.

Any update here? I suspect Jdlrobson would be happy to help assist over IRC, if needed.